Skip to content

Commit

Permalink
prevent webpack from injecting useless mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 21, 2017
1 parent 7ba65e8 commit 7cf7d41
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions template/build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,17 @@ module.exports = {
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}

0 comments on commit 7cf7d41

Please sign in to comment.