When using a module from the ArcGIS API for JavaScript in the web worker, "npm run dev" works fine but "npm run build" (which, I think uses Rollup), fails with the error:
To preserve the export signature of the entry module "src\testWorker.ts", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.
โ 10 modules transformed.
[vite:worker] Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.
file: C:/.../svelte-vite-web-workers-issue/src/testWorker.ts?worker
error during build:
Error: Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.