Skip to content

Commit e073f5a

Browse files
committed
feat: dedupe the vue in client bundle by default
Fixes vitejs#2443 Fixes vitejs#7454 It's already been set by default in Nuxt 3 for a while now nuxt/framework#6735 So I think this change should be harmless. And technically it could be considered a fix than a feat. Nevertheless, it's better to ship it in v4 to minimize disruptions on the user side. Things that are not covered in this PR: 1. SSR, because `resolve.dedupe` doesn't work for ESM build outputs, and the CommonJS version is kinda hacky, I think it's better to skip the config for SSR completely. Besides, most related issues are from the client side. 2. #5958 isn't fixed by this PR.
1 parent 1b1f633 commit e073f5a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/plugin-vue/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
128128

129129
config(config) {
130130
return {
131+
resolve: {
132+
dedupe: config.build?.ssr ? [] : ['vue']
133+
},
131134
define: {
132135
__VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
133136
__VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false

0 commit comments

Comments
 (0)