Skip to content
This repository was archived by the owner on May 12, 2022. It is now read-only.
This repository was archived by the owner on May 12, 2022. It is now read-only.

Support file loader? #28

Open
Open
@saitonakamura

Description

@saitonakamura

I use it in pair with uvu to transpile typescript. When I'm trying to test a file than imports, for instance, a png file (which is set up as --loader:.png=file in my esbuild cli), node throws with

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".png" for /blabla/star.png
    at defaultGetFormat (internal/modules/esm/get_format.js:71:15)
    at getFormat (file://node_modules/esbuild-node-loader/loader.mjs:162:10)

It's obviously not a problem of this loader, but I'm stuggling to understand how to properly apporach it. Since esbuild supports file loader, maybe it makes sense to somehow support it inside this loader? Or it's better to chain loaders via https://github.com/lukeed/loadr and provide some fake one for certain extensions. I'd appreciate some guidance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions