webpack/examples/two-explicit-vendor-chunks/webpack.config.js

35 lines
544 B
JavaScript
Raw Permalink Normal View History

"use strict";
2024-07-31 09:56:53 +08:00
const path = require("path");
module.exports = {
2023-03-12 10:27:40 +08:00
// mode: "development" || "production",
entry: {
2015-04-30 02:34:04 +08:00
vendor1: ["./vendor1"],
vendor2: ["./vendor2"],
pageA: "./pageA",
pageB: "./pageB",
pageC: "./pageC"
},
output: {
path: path.join(__dirname, "dist"),
filename: "[name].js"
},
optimization: {
splitChunks: {
cacheGroups: {
vendor1: {
name: "vendor1",
test: "vendor1",
enforce: true
},
vendor2: {
name: "vendor2",
test: "vendor2",
enforce: true
}
}
}
}
2017-01-11 17:51:58 +08:00
};