apply(compiler) {
		compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
			const hooks =
				getModuleFederationPlugin().getCompilationHooks(compilation);
			const depsToTrace = new Set();
			const entryExternalsToHoist = new Set();
			hooks.addContainerEntryDependency.tap(PLUGIN_NAME, dep => {
				depsToTrace.add(dep);
			});
			hooks.addFederationRuntimeDependency.tap(PLUGIN_NAME, dep => {
				depsToTrace.add(dep);
			});

			compilation.hooks.addEntry.tap(PLUGIN_NAME, entryDep => {
				if (entryDep.type === "entry") {
					entryExternalsToHoist.add(entryDep);
				}
			});

			// Hook into the optimizeChunks phase
			compilation.hooks.optimizeChunks.tap(
				{
					name: PLUGIN_NAME,
					// advanced stage is where SplitChunksPlugin runs.
					stage: STAGE_ADVANCED + 1
				},
				chunks => {
					this.hoistModulesInChunks(
						compilation,
						depsToTrace,
						entryExternalsToHoist
					);
				}
			);
		});
	}
Apply the plugin to the compiler.
@param {Compiler} compiler The webpack compiler instance.