| | |
| | | "Common configuration options that specific library names are 'output.library[.name]', 'entry.xyz.library[.name]', 'ModuleFederationPlugin.name' and 'ModuleFederationPlugin.library[.name]'."; |
| | | |
| | | /** |
| | | * Defines the library context type used by this module. |
| | | * @template T |
| | | * @typedef {object} LibraryContext |
| | | * @property {Compilation} compilation |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the abstract library plugin options type used by this module. |
| | | * @typedef {object} AbstractLibraryPluginOptions |
| | | * @property {string} pluginName name of the plugin |
| | | * @property {LibraryType} type used library type |
| | | */ |
| | | |
| | | /** |
| | | * Represents AbstractLibraryPlugin. |
| | | * @template T |
| | | */ |
| | | class AbstractLibraryPlugin { |
| | | /** |
| | | * Creates an instance of AbstractLibraryPlugin. |
| | | * @param {AbstractLibraryPluginOptions} options options |
| | | */ |
| | | constructor({ pluginName, type }) { |
| | | /** @type {AbstractLibraryPluginOptions["pluginName"]} */ |
| | | this._pluginName = pluginName; |
| | | /** @type {AbstractLibraryPluginOptions["type"]} */ |
| | | this._type = type; |
| | | /** @type {WeakMap<LibraryOptions, T>} */ |
| | | this._parseCache = new WeakMap(); |
| | | } |
| | | |
| | | /** |
| | | * Apply the plugin |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {void} |
| | | */ |
| | |
| | | ); |
| | | |
| | | /** |
| | | * Gets options for chunk. |
| | | * @param {Chunk} chunk chunk |
| | | * @returns {T | false} options for the chunk |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Parse options cached. |
| | | * @param {LibraryOptions=} library normalized library option |
| | | * @returns {T | false} preprocess as needed by overriding |
| | | */ |
| | |
| | | |
| | | /* istanbul ignore next */ |
| | | /** |
| | | * Returns preprocess as needed by overriding. |
| | | * @abstract |
| | | * @param {LibraryOptions} library normalized library option |
| | | * @returns {T | false} preprocess as needed by overriding |
| | | * @returns {T} preprocess as needed by overriding |
| | | */ |
| | | parseOptions(library) { |
| | | const AbstractMethodError = require("../AbstractMethodError"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Finish entry module. |
| | | * @param {Module} module the exporting entry module |
| | | * @param {string} entryName the name of the entrypoint |
| | | * @param {LibraryContext<T>} libraryContext context |
| | |
| | | finishEntryModule(module, entryName, libraryContext) {} |
| | | |
| | | /** |
| | | * Embed in runtime bailout. |
| | | * @param {Module} module the exporting entry module |
| | | * @param {RenderContext} renderContext render context |
| | | * @param {LibraryContext<T>} libraryContext context |
| | |
| | | } |
| | | |
| | | /** |
| | | * Strict runtime bailout. |
| | | * @param {RenderContext} renderContext render context |
| | | * @param {LibraryContext<T>} libraryContext context |
| | | * @returns {string | undefined} bailout reason |
| | |
| | | } |
| | | |
| | | /** |
| | | * Processes the provided chunk. |
| | | * @param {Chunk} chunk the chunk |
| | | * @param {RuntimeRequirements} set runtime requirements |
| | | * @param {LibraryContext<T>} libraryContext context |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns source with library export. |
| | | * @param {Source} source source |
| | | * @param {RenderContext} renderContext render context |
| | | * @param {LibraryContext<T>} libraryContext context |
| | |
| | | } |
| | | |
| | | /** |
| | | * Renders source with library export. |
| | | * @param {Source} source source |
| | | * @param {Module} module module |
| | | * @param {StartupRenderContext} renderContext render context |
| | |
| | | } |
| | | |
| | | /** |
| | | * Renders module content. |
| | | * @param {Source} source source |
| | | * @param {Module} module module |
| | | * @param {ModuleRenderContext} renderContext render context |
| | | * @param {Omit<LibraryContext<T>, 'options'>} libraryContext context |
| | | * @param {Omit<LibraryContext<T>, "options">} libraryContext context |
| | | * @returns {Source} source with library export |
| | | */ |
| | | renderModuleContent(source, module, renderContext, libraryContext) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Processes the provided chunk. |
| | | * @param {Chunk} chunk the chunk |
| | | * @param {Hash} hash hash |
| | | * @param {ChunkHashContext} chunkHashContext chunk hash context |