webpack/examples/common-chunk-and-vendor-chunk/webpack.config.js

29 lines
506 B
JavaScript
Raw Normal View History

2016-01-04 11:07:08 +08:00
var path = require("path");
module.exports = {
// mode: "development" || "production",
2016-01-04 11:07:08 +08:00
entry: {
pageA: "./pageA",
pageB: "./pageB",
pageC: "./pageC"
},
optimization: {
splitChunks: {
chunks: "initial",
minSize: 0, // This is example is too small to create commons chunks
name: "common",
cacheGroups: {
vendor: {
test: /node_modules/,
name: "vendor",
enforce: true
}
}
}
2016-01-04 11:07:08 +08:00
},
output: {
path: path.join(__dirname, "dist"),
2016-01-04 11:07:08 +08:00
filename: "[name].js"
}
2016-01-04 11:07:08 +08:00
};