Skip to content

this code is not run when i configured in vue.config.js,it can cause template.html without complier #48

Description

@chdhyangbo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions