配置文件
const path = require("path");
const HTMLWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: { main1: "./entry1.js", main2: "./entry2.js" },
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
},
plugins: [
new HTMLWebpackPlugin({
chunks: ['main1'],
filename: "index1.html",
}),
new HTMLWebpackPlugin({
chunks: ['main2'],
filename: "index2.html",
}),
],
};