apply(compiler) {
		// hook into the compiler to get a Compilation instance...
		tap(compiler, 'compilation', PLUGIN_NAME, false, compilation => {
			this.options.path = compiler.options.output.path;
			this.options.publicPath = compiler.options.output.publicPath;

			const handleHtmlPluginData = (htmlPluginData, callback) => {
				this.fs = compilation.outputFileSystem;
				this.compilation = compilation;
				this.process(htmlPluginData.html)
					.then(html => {
						callback(null, { html });
					})
					.catch(callback);
			};

			HtmlWebpackPlugin.getHooks(compilation).beforeEmit.tapAsync(
				PLUGIN_NAME,
				handleHtmlPluginData
			);
		});
	}
Invoked by Webpack during plugin initialization