| | |
| | | |
| | | class AMDPlugin { |
| | | /** |
| | | * Creates an instance of AMDPlugin. |
| | | * @param {AmdOptions} amdOptions the AMD options |
| | | */ |
| | | constructor(amdOptions) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Apply the plugin |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {void} |
| | | */ |
| | | apply(compiler) { |
| | | const amdOptions = this.amdOptions; |
| | | const { amdOptions } = this; |
| | | compiler.hooks.compilation.tap( |
| | | PLUGIN_NAME, |
| | | (compilation, { contextModuleFactory, normalModuleFactory }) => { |
| | |
| | | }); |
| | | |
| | | /** |
| | | * Handles the hook callback for this code path. |
| | | * @param {Parser} parser parser parser |
| | | * @param {JavascriptParserOptions} parserOptions parserOptions |
| | | * @returns {void} |
| | |
| | | if (parserOptions.amd !== undefined && !parserOptions.amd) return; |
| | | |
| | | /** |
| | | * Processes the provided option expr. |
| | | * @param {string} optionExpr option expression |
| | | * @param {string} rootName root name |
| | | * @param {GetMembers} getMembers callback |