diff --git a/packages/@vue/cli-plugin-unit-mocha/index.js b/packages/@vue/cli-plugin-unit-mocha/index.js index cfdec0aa5f..ad1975a684 100644 --- a/packages/@vue/cli-plugin-unit-mocha/index.js +++ b/packages/@vue/cli-plugin-unit-mocha/index.js @@ -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 }) - } } }) diff --git a/packages/@vue/cli-service/package.json b/packages/@vue/cli-service/package.json index 9e30d1bfdb..5e5c993043 100644 --- a/packages/@vue/cli-service/package.json +++ b/packages/@vue/cli-service/package.json @@ -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",