-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Labels
enhancementNew feature or requestNew feature or requestfeat: web workersperformancePerformance related enhancementPerformance related enhancement
Description
Clear and concise description of the problem
Due to size of my project, I generate multiple large worker files, but vite currently only supports generating worker files in either iife mode or esm mode.
The problem is that using esm from just a treeshake perspective, drastically improves perfs. but using esm means I can't support Firefox, and using iife means a noticeable delay in load times.
Suggested solution
- Support generating multiple different worker files, giving the user the ability to customize these files, not too different from vite's current build.lib option. The user could then on their own determine when to use which worker file in their own code.
Alternative
- Support treeshaking iife workers, I don't know if that is possible?
Additional context
I am building an online bundler using esbuild-wasm, monaco, a bunch of fairly large plugin logic for esbuild, a couple instances of typescript, an instance of rollup, etc... All these files mean the worker file can ballon quite a bit very quickly.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfeat: web workersperformancePerformance related enhancementPerformance related enhancement