2014-02-04 01:20:55 +08:00
|
|
|
var path = require("path");
|
|
|
|
module.exports = {
|
2017-12-14 17:09:09 +08:00
|
|
|
// mode: "development || "production",
|
2014-02-04 01:20:55 +08:00
|
|
|
entry: {
|
|
|
|
// The entry points for the pages
|
2018-01-20 00:06:59 +08:00
|
|
|
// They also contains router
|
|
|
|
pageA: ["./aEntry", "./router"],
|
2018-02-25 09:00:20 +08:00
|
|
|
pageB: ["./bEntry", "./router"]
|
2014-02-04 01:20:55 +08:00
|
|
|
},
|
|
|
|
output: {
|
2018-01-05 04:39:29 +08:00
|
|
|
path: path.join(__dirname, "dist"),
|
2017-01-11 17:51:58 +08:00
|
|
|
publicPath: "js/",
|
2014-02-04 01:20:55 +08:00
|
|
|
filename: "[name].bundle.js",
|
2018-01-20 00:06:59 +08:00
|
|
|
chunkFilename: "[name].chunk.js"
|
2014-02-04 01:20:55 +08:00
|
|
|
},
|
2017-12-14 17:09:09 +08:00
|
|
|
optimization: {
|
2018-01-20 00:06:59 +08:00
|
|
|
// Extract common modules from initial chunks too
|
|
|
|
// This is optional, but good for performance.
|
|
|
|
splitChunks: {
|
|
|
|
chunks: "all",
|
|
|
|
minSize: 0 // This example is too small
|
|
|
|
},
|
2018-07-15 04:16:32 +08:00
|
|
|
chunkIds: "total-size" // To keep filename consistent between different modes (for example building only)
|
2017-12-14 17:09:09 +08:00
|
|
|
}
|
2017-01-11 17:51:58 +08:00
|
|
|
};
|