Vite dev server optimize entries
See original GitHub issueCurrent behavior
I have a problems with component tests
If I add node_modules dependency into support file - this dependency wouldn’t be pre-bundled by Vite. This is because Cypress pass supportFile
into optimizeDeps.entries as is - and this is wrong for windows.
cypress/npm/vite-dev-server/src/startServer.ts
optimizeDeps.entries
is array of fast-glob patterns
Desired behavior
All node_modules dependencies which are imported inside supportFile
must be pre-bundled on windows too
Test code to reproduce
I’ve created repo to reproduce this https://github.com/edikdeisling/test-cypress-cmp-tests-pre-bundling
Make sure there is no .vite in node_modules and run yarn test:component:run
Cypress Version
8.4.1
Other
There is another issue here to be honest. I think this is wrong to rewrite optimizeDeps.entries
. Because of this behaviour I can’t add my own optimizeDeps.entries
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
@edikdeisling @lmiller1990 I’m fixing this, just testing:
with result on @edikdeisling fork:
We should be concat-ing with the optimizeDeps, not overwriting. Good catch, will look into both these.