-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue is externalized no matter the ssr.noExternal
value
#9117
Comments
It worked with extra plugin mutating |
Indeed, thanks 👍. This feels a bit hackish though. Is there any particular reason that Vue won't be externalised despite the |
I think Vite checks vite/packages/vite/src/node/ssr/ssrExternal.ts Lines 123 to 130 in d12d469
|
I think this part is affecting this. Since vite 3 externalizes everything, maybe this should be removed. vite/packages/plugin-vue/src/index.ts Lines 126 to 128 in a2b3131
|
Describe the bug
I'm migrating a project from vite 2 to 3, and just facing a little issue with SSR externals.
It vite 2, I was just using something like
noExternal: /./
to make sure nothing is externalised, which worked well.In Vite 3, it seems that
vue
and@vue/server-renderer
are not externalised (the generated output imports vue methods from the vue package). All others deps are bundled into the mjs output.I tried to set
ssr.noExternal
to true, but then I got various error likeCannot bundle Node.js built-in "http" imported from "node_modules/axios/lib/adapters/http.js". Consider disabling ssr.noExternal or remove the built-in dependency
I also tried to manually exclude 'vue' package with something like noExternal: [/./, 'vue'] with no luck
Another weird thing is that the import output looks broken too. I tried to add
vue
as a deps as a workaround but got thisReproduction
https://stackblitz.com/edit/vitejs-vite-7k3ode?file=dist/server/entry-server.js
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: