Skip to content
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

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

Merged
merged 2 commits into from Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/@vue/cli-plugin-unit-mocha/index.js
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
Expand Up @@ -72,7 +72,7 @@
"thread-loader": "^3.0.0",
"url-loader": "^4.1.1",
"vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.0.0-beta.7",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0",
Expand Down