vite icon indicating copy to clipboard operation
vite copied to clipboard

Change to vite.config.js optimizeDeps does not trigger Pre-bundling of dependencies

Open coder-guy22296 opened this issue 4 years ago • 0 comments

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

  1. go to the reproduction link IMPORTANT: fork this blitz on top left of page (MUST DO FIRST in order to reproduce)
  2. observe an error in console
  3. in vite.config.js uncomment esbuildCommonjs plugin
  4. restart dev server: npm run dev (does not fix)
  5. npm run dev --force (does not fix)
  6. rm -rf node_modules
  7. npm install
  8. 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

coder-guy22296 avatar Feb 10 '22 18:02 coder-guy22296