2018-04-23 19:41:00 +08:00
|
|
|
const stats = {
|
|
|
|
|
hash: false,
|
|
|
|
|
timings: false,
|
|
|
|
|
builtAt: false,
|
|
|
|
|
assets: false,
|
|
|
|
|
chunks: true,
|
|
|
|
|
chunkOrigins: true,
|
|
|
|
|
modules: false
|
|
|
|
|
};
|
2018-04-25 14:36:18 +08:00
|
|
|
|
|
|
|
|
const config = {
|
2018-04-23 19:41:00 +08:00
|
|
|
mode: "production",
|
|
|
|
|
entry: {
|
|
|
|
|
main: "./"
|
|
|
|
|
},
|
|
|
|
|
optimization: {
|
|
|
|
|
splitChunks: {
|
|
|
|
|
minSize: 100,
|
|
|
|
|
cacheGroups: {
|
|
|
|
|
vendors: {
|
|
|
|
|
test: /[\\/]node_modules[\\/]/,
|
|
|
|
|
chunks: "async",
|
|
|
|
|
enforce: true,
|
|
|
|
|
name: "vendors"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-25 14:36:18 +08:00
|
|
|
}
|
2018-04-23 19:41:00 +08:00
|
|
|
};
|
2018-04-25 14:36:18 +08:00
|
|
|
|
|
|
|
|
module.exports = [
|
2019-06-19 19:16:05 +08:00
|
|
|
{
|
|
|
|
|
stats: { entrypoints: false, chunkGroups: true, ...stats },
|
2019-11-05 17:04:01 +08:00
|
|
|
output: {
|
|
|
|
|
filename: "a-[name].js"
|
|
|
|
|
},
|
2019-06-19 19:16:05 +08:00
|
|
|
...config
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stats: { entrypoints: true, chunkGroups: true, ...stats },
|
2019-11-05 17:04:01 +08:00
|
|
|
output: {
|
|
|
|
|
filename: "b-[name].js"
|
|
|
|
|
},
|
2019-06-19 19:16:05 +08:00
|
|
|
...config
|
|
|
|
|
}
|
2018-04-25 14:36:18 +08:00
|
|
|
];
|