webpack/examples/hybrid-routing/webpack.config.js

26 lines
689 B
JavaScript
Raw Normal View History

var path = require("path");
module.exports = {
2023-03-12 10:27:40 +08:00
// mode: "development" || "production",
entry: {
// The entry points for the pages
// They also contains router
pageA: ["./aEntry", "./router"],
2018-02-25 09:00:20 +08:00
pageB: ["./bEntry", "./router"]
},
output: {
path: path.join(__dirname, "dist"),
2017-01-11 17:51:58 +08:00
publicPath: "js/",
filename: "[name].bundle.js",
chunkFilename: "[name].chunk.js"
},
optimization: {
// 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-12-19 21:05:17 +08:00
chunkIds: "named" // To keep filename consistent between different modes (for example building only)
}
2017-01-11 17:51:58 +08:00
};