| | |
| | | const enabledTypes = new WeakMap(); |
| | | |
| | | /** |
| | | * Defines the enable library plugin options type used by this module. |
| | | * @typedef {object} EnableLibraryPluginOptions |
| | | * @property {() => void=} additionalApply function that runs when applying the current plugin. |
| | | */ |
| | | |
| | | /** |
| | | * Returns enabled types. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {LibraryTypes} enabled types |
| | | */ |
| | | const getEnabledTypes = (compiler) => { |
| | | let set = enabledTypes.get(compiler); |
| | | if (set === undefined) { |
| | | /** @type {LibraryTypes} */ |
| | | set = new Set(); |
| | | enabledTypes.set(compiler, set); |
| | | } |
| | |
| | | |
| | | class EnableLibraryPlugin { |
| | | /** |
| | | * Creates an instance of EnableLibraryPlugin. |
| | | * @param {LibraryType} type library type that should be available |
| | | * @param {EnableLibraryPluginOptions} options options of EnableLibraryPlugin |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Updates enabled using the provided compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @param {LibraryType} type type of library |
| | | * @returns {void} |
| | |
| | | } |
| | | |
| | | /** |
| | | * Checks enabled. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @param {LibraryType} type type of library |
| | | * @returns {void} |
| | |
| | | } |
| | | |
| | | /** |
| | | * Apply the plugin |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {void} |
| | | */ |
| | |
| | | |
| | | class WarnFalseIifeUmdPlugin { |
| | | /** |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | */ |
| | | apply(compiler) { |