mirror of https://github.com/webpack/webpack.git
fix: rename hooks to be correct
This commit is contained in:
parent
07670cf9e8
commit
d0bfad35ae
|
|
@ -88,7 +88,7 @@ class ContainerPlugin {
|
|||
},
|
||||
error => {
|
||||
if (error) return callback(error);
|
||||
hooks.addContainerEntryModule.call(dep);
|
||||
hooks.addContainerEntryDependency.call(dep);
|
||||
callback();
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ class HoistContainerReferences {
|
|||
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
|
||||
const hooks = ModuleFederationPlugin.getCompilationHooks(compilation);
|
||||
const containerEntryDependencies = new Set();
|
||||
hooks.addContainerEntryModule.tap(PLUGIN_NAME, dep => {
|
||||
hooks.addContainerEntryDependency.tap(PLUGIN_NAME, dep => {
|
||||
containerEntryDependencies.add(dep);
|
||||
});
|
||||
hooks.addFederationRuntimeModule.tap(PLUGIN_NAME, dep => {
|
||||
hooks.addFederationRuntimeDependency.tap(PLUGIN_NAME, dep => {
|
||||
containerEntryDependencies.add(dep);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ const ContainerReferencePlugin = require("./ContainerReferencePlugin");
|
|||
|
||||
/**
|
||||
* @typedef {object} CompilationHooks
|
||||
* @property {SyncHook} addContainerEntryModule
|
||||
* @property {SyncHook} addFederationRuntimeModule
|
||||
* @property {SyncHook} addContainerEntryDependency
|
||||
* @property {SyncHook} addFederationRuntimeDependency
|
||||
*/
|
||||
|
||||
const validate = createSchemaValidation(
|
||||
|
|
@ -60,8 +60,8 @@ class ModuleFederationPlugin {
|
|||
let hooks = compilationHooksMap.get(compilation);
|
||||
if (!hooks) {
|
||||
hooks = {
|
||||
addContainerEntryModule: new SyncHook(["dependency"]),
|
||||
addFederationRuntimeModule: new SyncHook(["module"])
|
||||
addContainerEntryDependency: new SyncHook(["dependency"]),
|
||||
addFederationRuntimeDependency: new SyncHook(["dependency"])
|
||||
};
|
||||
compilationHooksMap.set(compilation, hooks);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2307,8 +2307,8 @@ declare interface CompilationHooksJavascriptModulesPlugin {
|
|||
useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
|
||||
}
|
||||
declare interface CompilationHooksModuleFederationPlugin {
|
||||
addContainerEntryModule: SyncHook<any>;
|
||||
addFederationRuntimeModule: SyncHook<any>;
|
||||
addContainerEntryDependency: SyncHook<any>;
|
||||
addFederationRuntimeDependency: SyncHook<any>;
|
||||
}
|
||||
declare interface CompilationHooksRealContentHashPlugin {
|
||||
updateHash: SyncBailHook<[Buffer[], string], string>;
|
||||
|
|
|
|||
Loading…
Reference in New Issue