Open NfNitLoop opened 3 months ago
FWIW, I previously rolled my own code that was similar to esbuild-deno-loader, but decided to adopt esbuild-deno-loader to support JSR imports. My loader explicitly only applied to particular kinds of imports (back then, http[s] imports), so it didn't run into this issue. So I expect filtering to just js/ts/jsx/tsx imports here might be a quick fix?
I'd love to use this to bundle resources that may include Deno code and non-JS code (like CSS/SCSS files).
But adding the plugin to my ESBuild configuration breaks if there are files that aren't TypeScript/JavaScript.
IMO, if this plugin doesn't know how to handle these files, it should just skip them and allow other plugins (or esbuild itself) to handle them.
Reproduction
I've got a minimal reproduction here:
https://github.com/NfNitLoop/deno-loader-bug
With a config like this:
This works, but if you uncomment the
denoPlugins()
line you get errors: