Open KubesDavid opened 2 years ago
Yes, this must not be happening.
For a workaround, you can use Import with Constructors.
@sapphi-red That doesn't solve the problem of workers always being built in iife
mode even when the user has specifically chosen esm
as their build format.
Describe the bug
After running
vite build
, Worker is built in legacy mode with the{type: "module"}
option, which is undesirable in this case and results in the application breaking in older browser versions.vite.config.ts
index-legacy.057ce815.js
Reproduction
https://stackblitz.com/edit/node-kfimtt
System Info
Used Package Manager
npm
Logs
No response
Validations