2020-04-20 15:23:10 +08:00
|
|
|
/** @type {import("../../../../").Configuration[]} */
|
2018-12-29 19:48:59 +08:00
|
|
|
module.exports = [
|
|
|
|
{
|
|
|
|
name: "default",
|
|
|
|
entry: "./index",
|
|
|
|
target: "node",
|
|
|
|
output: {
|
|
|
|
filename: "default-[name].js",
|
|
|
|
libraryTarget: "commonjs2"
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
splitChunks: {
|
|
|
|
minSize: 1,
|
|
|
|
chunks: "all"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "many-vendors",
|
|
|
|
entry: "./index",
|
|
|
|
target: "node",
|
|
|
|
output: {
|
|
|
|
filename: "many-vendors-[name].js",
|
|
|
|
libraryTarget: "commonjs2"
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
splitChunks: {
|
|
|
|
minSize: 1,
|
|
|
|
chunks: "all",
|
|
|
|
maxInitialRequests: Infinity,
|
|
|
|
cacheGroups: {
|
|
|
|
default: false,
|
|
|
|
defaultVendors: false,
|
|
|
|
vendors: {
|
|
|
|
test: /node_modules/,
|
|
|
|
name: m => {
|
|
|
|
const match = m.nameForCondition().match(/([b-d]+)\.js$/);
|
2019-02-19 15:58:46 +08:00
|
|
|
if (match) return "vendors-" + match[1];
|
2018-12-29 19:48:59 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|