// 之前
webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
// webpack5
webpack serve --config build/webpack.dev.conf.js --progress --mode development
webpack3升5之后,webpack.config.js
文件里很多配置都会报错,因为v3和v5的配置schema不同了。这些可以从控制台报错的时候提示看出来。
比如:
// v3的时候配置的
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'
}
// v5的node泛型约定是 boolean | object
node: boolean | {
global: boolean | 'warn';
__filename: