Replies: 5 comments 9 replies
-
I have two questions for this.
My solutions:
|
Beta Was this translation helpful? Give feedback.
-
Hi. This is a feedback specifically for the use case of Actually this issue on Vitest vitest-dev/vitest#4910 made me realize why As reported on Vitest's issue, it seems currently calling On my use case, triggering import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
{
name: 'force-ssr-optimize-deps',
apply: "serve",
configureServer(server) {
return async () => {
// load any module to trigger deps optimization
await server.ssrLoadModule('/dummy-module.js');
};
},
},
],
}); My concrete feedback/question would be:
On additional notes, Maybe I should mentioned this earlier as a high level motivation of why I need |
Beta Was this translation helpful? Give feedback.
-
Deps optimization with When I try to build the pnpm branch of my repo:
However, navigating there will give you a relatively blank page, with this error in the JS console:
This is because the request for the Navigating to the network tab, you can see that we're requesting the To see what this project is like when it works:
|
Beta Was this translation helpful? Give feedback.
-
Deps optimization at build time was removed in vite@5.1. Check out the rationale at:
|
Beta Was this translation helpful? Give feedback.
-
Many of my projects only uses Vitest, not Vite. Because Vitest uses Vite under-the-hood, I'd love to remove dependency optimization altogether with an option like this. Dependency optimization doesn't help with CI as far as I understand, and it's causing strange issues in the CI where tests fail the first run only while it's creating the Also, running Lastly, if I use the Vitest VSCode plugin, it doesn't create I would recommend having some way to configure around having dependency optimization. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Deps Optimization at build and SSR
optimizeDeps.disabled
ssr.optimizeDeps
Open questions:
optimizeDeps.dev: boolean, optimizeDeps.build: boolean
instead ofoptimizeDeps.disabled: 'dev' | 'build' | boolean
If you have feedback about this feature, let's use this discussion to gather it.
Resolution: #13839 (comment)
Beta Was this translation helpful? Give feedback.
All reactions