web-webpack-plugin icon indicating copy to clipboard operation
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

Open chdhyangbo opened this issue 5 years ago • 1 comments

// 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);
	});

chdhyangbo avatar Oct 09 '20 04:10 chdhyangbo

i forget config plugins :[autoWebPlugin],sorry

chdhyangbo avatar Oct 09 '20 23:10 chdhyangbo