| | |
| | | |
| | | class ModuleChunkLoadingPlugin { |
| | | /** |
| | | * Apply the plugin |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {void} |
| | | */ |
| | |
| | | compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => { |
| | | const globalChunkLoading = compilation.outputOptions.chunkLoading; |
| | | /** |
| | | * Checks whether this module chunk loading plugin is enabled for chunk. |
| | | * @param {Chunk} chunk chunk to check |
| | | * @returns {boolean} true, when the plugin is enabled for the chunk |
| | | */ |
| | |
| | | : globalChunkLoading; |
| | | return chunkLoading === "import"; |
| | | }; |
| | | /** @type {WeakSet<Chunk>} */ |
| | | const onceForChunkSet = new WeakSet(); |
| | | /** |
| | | * Handles the hook callback for this code path. |
| | | * @param {Chunk} chunk chunk to check |
| | | * @param {RuntimeRequirements} set runtime requirements |
| | | */ |