vite-plugin-singlefile
vite-plugin-singlefile copied to clipboard
Support Web Worker files (eg. autocomplete.worker.js?worker syntax)
It looks like web worker js files with the ?worker suffix are ignored by this plugin.
My app uses an import such as:
import AutocompleteWorker from "@/autocomplete.worker.js?worker";
My output produces:
npm run build
build vite build
vite v5.3.3 building for production... ✓ 293 modules transformed. rendering chunks (1)...
Inlining: index-CIvNPwLS.js Inlining: style-BvRGwxcl.css dist/autocomplete.worker-CFomeDza.js 90.96 kB dist/index.html 1,964.05 kB
I think it's just a matter of updating the isJsFile
regex at https://github.com/richardtallent/vite-plugin-singlefile/blob/main/src/index.ts#L42 ?