Skip to content

Commit

Permalink
fix(mocha): disable SSR optimization for Vue 3 testing (#6097)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Jan 6, 2021
1 parent 4f69a43 commit 76a0418
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions packages/@vue/cli-plugin-unit-mocha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
}
})

Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 76a0418

Please sign in to comment.