2014-02-04 01:20:55 +08:00
|
|
|
var path = require("path");
|
|
|
|
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
|
|
|
// The entry points for the pages
|
|
|
|
pageA: "./aEntry",
|
|
|
|
pageB: "./bEntry",
|
|
|
|
|
|
|
|
// This file contains common modules but also the router entry
|
|
|
|
"commons.js": "./router"
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, "js"),
|
2014-06-12 05:50:32 +08:00
|
|
|
publicPath: 'js/',
|
2014-02-04 01:20:55 +08:00
|
|
|
filename: "[name].bundle.js",
|
|
|
|
chunkFilename: "[id].chunk.js"
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
// Extract common modules from the entries to the commons.js file
|
|
|
|
// This is optional, but good for performance.
|
2016-02-04 07:27:47 +08:00
|
|
|
new CommonsChunkPlugin({
|
|
|
|
name: "commons",
|
|
|
|
filename: "commons.js"
|
|
|
|
})
|
2014-02-04 01:20:55 +08:00
|
|
|
// The pages cannot run without the commons.js file now.
|
|
|
|
]
|
2014-06-12 05:50:32 +08:00
|
|
|
}
|