vite
vite copied to clipboard
Inlined workers aren't being rebuilt while using `lib` mode and `build --watch`
Describe the bug
When using vite build --watch and lib mode, workers which are imported and inlined aren't being rebuilt.
In the reproduction linked, you can run npm run watch-lib in one terminal and npm run dev in the other and modify inlineWorker.ts. The lib will rebuild, and the dev server will trigger a reload, but the inlined worker will remain the same.
Possibly related to https://github.com/vitejs/vite/issues/3566 and https://github.com/vitejs/vite/issues/3909
Reproduction
https://stackblitz.com/edit/vitejs-vite-2cucaj?file=worker/inlineWorker.ts
System Info
System:
OS: macOS 12.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 69.00 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
npm: 8.10.0 - ~/.volta/tools/image/npm/8.10.0/bin/npm
Browsers:
Chrome: 101.0.4951.64
Firefox: 97.0.1
Safari: 15.4
Used Package Manager
npm
Logs
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.