web-webpack-plugin
web-webpack-plugin copied to clipboard
this code is not run when i configured in vue.config.js,it can cause template.html without complier
// call by webpack apply(compiler) { global._isProduction = util.isProduction(compiler); global._isExtractStyle = util.isExtractStyle(compiler); const { options: compilerOptions } = compiler; const { entryMap } = this; const { outputPagemap, outputPagemapFilename, requires = [], ...otherOptions } = this.options;
Object.keys(entryMap).forEach((pageName) => {
// ensure entryMap from pages has been add to webpack entry
// webpack-dev-server may modify compilerOptions.entry, e.g add webpack-dev-server/client to every entry
compilerOptions.entry = Object.assign(
this.webpackEntry,
compilerOptions.entry,
);
// add an WebPlugin for every page to output an html
const {
templatePath,
templateCompiler,
htmlOutputFilename,
entryPath,
} = entryMap[pageName];
new WebPlugin({
...otherOptions,
template: templatePath,
templateCompiler,
pageName,
entryPath,
filename: `${htmlOutputFilename}.html`,
requires: requires.concat(pageName),
}).apply(compiler);
});
i forget config plugins :[autoWebPlugin],sorry