fix(mocha): disable SSR optimization for Vue 3 testing (#6097)

Fixes https://github.com/vuejs/vue-loader/issues/1734
This commit is contained in:
Haoqun Jiang
2020-11-30 15:20:21 +08:00
parent 4f69a43f8b
commit 76a04180be
2 changed files with 8 additions and 6 deletions
+7 -5
View File
@@ -12,16 +12,18 @@ module.exports = api => {
// when target === 'node', vue-loader will attempt to generate
// SSR-optimized code. We need to turn that off here.
// the `optimizeSSR` option is only available in vue-loader 15
if (!isVue3) {
webpackConfig.module
webpackConfig.module
.rule('vue')
.use('vue-loader')
.tap(options => {
options.optimizeSSR = false
if (isVue3) {
options.isServerBuild = false
} else {
options.optimizeSSR = false
}
return options
})
}
}
})
+1 -1
View File
@@ -80,7 +80,7 @@
"webpack-merge": "^4.2.2"
},
"optionalDependencies": {
"vue-loader-v16": "npm:vue-loader@^16.0.0-beta.7"
"vue-loader-v16": "npm:vue-loader@^16.1.0"
},
"peerDependencies": {
"@vue/compiler-sfc": "^3.0.0-beta.14",