karma-esbuild
karma-esbuild copied to clipboard
When using file loaders, processResult throws an error
When using an esbuild config with file loaders, the result.outputFiles
may contain files other than the sourcemap and resulting js.
This causes an error here https://github.com/marvinhagemeister/karma-esbuild/blob/bcf99827e49c0451feeb27e5bd75c6a5ea049361/src/bundle.ts#L153-L154 when it tries to parse some other file as a sourcemap and fails
Do you have an example of how to reproduce this? I'm not sure what file loader you're referencing.
I meant this one https://esbuild.github.io/content-types/#external-file
So you could do
import url from "./somefile.txt";
and configure esbuild with
require('esbuild').buildSync({
entryPoints: ['app.js'],
bundle: true,
loader: { '.txt': 'file' },
outdir: 'out',
})
and it should output both the bundle and the .txt file into out