缓存babel-loader
设置cacheDirectory为true,可以避免重复打包,相同代码直接使用缓存
module.exports = {
module: {
rules: [
{
test: /\.js$/,
include: srcPath,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true
}
}
]
}
]
}
}