现在项目逐渐变大,打包越来越慢,装了个插件看了一下,主要耗时在loader上面,万能的大佬们有优化什么方法吗?
在 loader 上加入 exclude 参数,去掉 node_modules 目录下的代码。
{
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
include: [
],
exclude: /node_modules/
}]
}
}