Skip to content

Commit 7cf7d41

Browse files
committed
prevent webpack from injecting useless mocks
1 parent 7ba65e8 commit 7cf7d41

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

template/build/webpack.base.conf.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,17 @@ module.exports = {
7878
}
7979
}
8080
]
81+
},
82+
node: {
83+
// prevent webpack from injecting useless setImmediate polyfill because Vue
84+
// source contains it (although only uses it if it's native).
85+
setImmediate: false,
86+
// prevent webpack from injecting mocks to Node native modules
87+
// that does not make sense for the client
88+
dgram: 'empty',
89+
fs: 'empty',
90+
net: 'empty',
91+
tls: 'empty',
92+
child_process: 'empty'
8193
}
8294
}

0 commit comments

Comments
 (0)