vite
vite copied to clipboard
Change to vite.config.js optimizeDeps does not trigger Pre-bundling of dependencies
Describe the bug
Add a plugin to optimizeDeps.esbuildOptions.plugins does not automatically trigger Pre-bundling of dependencies, but requires deleting node_modules and reinstalling dependencies
Reproduction instructions
- go to the reproduction link IMPORTANT: fork this blitz on top left of page (MUST DO FIRST in order to reproduce)
- observe an error in console
- in vite.config.js uncomment esbuildCommonjs plugin
- restart dev server: npm run dev (does not fix)
- npm run dev --force (does not fix)
- rm -rf node_modules
- npm install
- npm run dev (fixed)
Reproduction
https://stackblitz.com/edit/vitejs-vite-ukkqu1?file=vite.config.js&terminal=dev
System Info
N/A reproduced on stackblitz
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.