2016-01-04 11:07:08 +08:00
|
|
|
var path = require("path");
|
|
|
|
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
|
|
|
|
|
|
|
|
module.exports = {
|
2017-12-14 17:09:09 +08:00
|
|
|
// mode: "development" || "production",
|
2016-01-04 11:07:08 +08:00
|
|
|
entry: {
|
|
|
|
vendor: ["./vendor1", "./vendor2"],
|
|
|
|
pageA: "./pageA",
|
|
|
|
pageB: "./pageB",
|
|
|
|
pageC: "./pageC"
|
|
|
|
// older versions of webpack may require an empty entry point declaration here
|
|
|
|
// common: []
|
|
|
|
},
|
|
|
|
output: {
|
2018-01-05 04:39:29 +08:00
|
|
|
path: path.join(__dirname, "dist"),
|
2016-01-04 11:07:08 +08:00
|
|
|
filename: "[name].js"
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CommonsChunkPlugin({
|
|
|
|
// The order of this array matters
|
|
|
|
names: ["common", "vendor"],
|
|
|
|
minChunks: 2
|
|
|
|
})
|
|
|
|
]
|
|
|
|
};
|