| | |
| | | |
| | | class ContextReplacementPlugin { |
| | | /** |
| | | * Creates an instance of ContextReplacementPlugin. |
| | | * @param {RegExp} resourceRegExp A regular expression that determines which files will be selected |
| | | * @param {(string | ((context: BeforeContextResolveData | AfterContextResolveData) => void) | RegExp | boolean)=} newContentResource A new resource to replace the match |
| | | * @param {(boolean | NewContentCreateContextMap | RegExp)=} newContentRecursive If true, all subdirectories are searched for matches |
| | |
| | | ) { |
| | | this.newContentResource = newContentResource; |
| | | /** |
| | | * Stores new content create context map. |
| | | * @param {InputFileSystem} fs input file system |
| | | * @param {(err: null | Error, newContentRecursive: NewContentCreateContextMap) => void} callback callback |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Apply the plugin |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {void} |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Creates a resolve dependencies from context map. |
| | | * @param {(fs: InputFileSystem, callback: (err: null | Error, map: NewContentCreateContextMap) => void) => void} createContextMap create context map function |
| | | * @returns {(fs: InputFileSystem, options: ContextModuleOptions, callback: (err: null | Error, dependencies?: ContextElementDependency[]) => void) => void} resolve resolve dependencies from context map function |
| | | */ |