Closed goldenratio closed 11 months ago
I fixed this by changing the target path based on NODE_ENV
const mode = process.env.NODE_ENV;
const mozJpegWASMCopy = ((pMode) => {
if (pMode === 'production') {
return {
src: "public/wasm/mozjpeg_wasm.wasm",
dest: "assets/",
};
}
return {
src: "public/wasm/mozjpeg_wasm.wasm",
dest: "src/internals/services/image-service/mozjpeg/internal\:comlink\:./",
};
})(mode);
plugins: [
viteStaticCopy({
targets: [
mozJpegWASMCopy
]
}),
Hey,
I am using comlink plugin to load workers and the workers inturn load .wasm files
In my vite plugins config, I have: (solution from https://stackoverflow.com/a/75616365/23147840)
any help is appreciated.