Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chdhyangbo opened this issue Oct 9, 2020 · 1 comment

Comments

@chdhyangbo
Copy link

// 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 chdhyangbo changed the title 这一段在vue.config.js配置后没有执行,导致template.html没有编译 this code is not run when i configured in vue.config.it can cause template.html without complilier Oct 9, 2020
@chdhyangbo chdhyangbo changed the title this code is not run when i configured in vue.config.it can cause template.html without complilier this code is not run when i configured in vue.config.js,it can cause template.html without complilier Oct 9, 2020
@chdhyangbo chdhyangbo changed the title this code is not run when i configured in vue.config.js,it can cause template.html without complilier this code is not run when i configured in vue.config.js,it can cause template.html without complier Oct 9, 2020
@chdhyangbo
Copy link
Author

i forget config plugins :[autoWebPlugin],sorry

@chdhyangbo chdhyangbo reopened this Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant