Why is Quasar deliberately not pre-bundled with Vite? #14084
-
I'm using @quasar/app-vite and the DX is not as good as I would hoped it to be, namely:
As I'm searching for an answer on why Vite is slow, I came across the fact that node_modules dependencies are normally pre-bundled to fix this exact problem (e.g. they talk about lodash-es making 600 HTTP requests). https://vitejs.dev/guide/dep-pre-bundling.html#the-why So I start a new project using I start a new quasar app vite project with the same components and it's slower since it's making 80 requests on each page refresh. Then, I realize that I didn't even use the @quasar/vite-plugin in my first project. I add it and then see that it explicitly disables pre-bundling, so it's now as slow as @quasar/app-vite. Demo projects are here https://github.com/philfontaine/demo-bug-quasar-cli-vite I've got 2 questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
So after experimenting a bit, turns out the problem is tied to the jsTransform and vueTransform done in @quasar/vite-plugin. However, these 2 are essential in production for tree shaking. So the solution would be:
There is also the I'll submit a PR later today. |
Beta Was this translation helpful? Give feedback.
So after experimenting a bit, turns out the problem is tied to the jsTransform and vueTransform done in @quasar/vite-plugin. However, these 2 are essential in production for tree shaking.
So the solution would be:
There is also the
optimizeDeps.exlude(['quasar'])
that needs to be switched off/on depending on dev/prod.I'll submit a PR later today.