first paste the project structure.
webpack.base.config.js
//
const SRC_PATH = path.resolve(__dirname, "../src");
const OUTPUT_PATH = path.resolve(__dirname, "../dist");
const PUBLIC_PATH = "/dist/";
// html-webpack-plugin
const getHtmlConfig = function(name){
};
const config = {
}
webpack.prod.config.js
const config = merge(baseConfig,{
})
indexaboutuserlodash
at this time, because splitChunks extracts the common module as vendor, but opens the three html files (index,about,user) generated by the last package, it is found that only the corresponding chunks: [name,"common"] is introduced, while vendor is not automatically introduced. I don"t think vendor should be written into the chunks item of webpackHtmlPlugin here, because suppose I index introduced a module. My user also introduced a module, but I may forget or do not know that the two modules are the same, but the splitChunks extracted, I can not all the webpackHtmlPlugin chunks items are introduced, that is meaningless ah, excuse me, is there a way to automatically introduce the public module extracted by splitChunks? Thank you