We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
Learn more about funding links in repositories.
Report abuse
1 parent ee13f7c commit fe9aed8Copy full SHA for fe9aed8
packages/@vue/cli-plugin-unit-mocha/index.js
@@ -2,9 +2,23 @@ module.exports = api => {
2
api.chainWebpack(webpackConfig => {
3
if (process.env.NODE_ENV === 'test') {
4
webpackConfig.merge({
5
+ target: 'node',
6
devtool: 'inline-cheap-module-source-map',
- externals: [require('webpack-node-externals')()]
7
+ externals: [
8
+ require('webpack-node-externals')(),
9
+ 'vue-server-renderer'
10
+ ]
11
})
12
+
13
+ // when target === 'node', vue-loader will attempt to generate
14
+ // SSR-optimized code. We need to turn that off here.
15
+ webpackConfig.module
16
+ .rule('vue')
17
+ .use('vue-loader')
18
+ .tap(options => {
19
+ options.optimizeSSR = false
20
+ return options
21
+ })
22
}
23
24
0 commit comments