new ContextReplacementPlugin(resourceRegExp, newContentResource?, newContentRecursive?, newContentRegExp?): ContextReplacementPluginAttributes
resourceRegExp:
RegExpA regular expression that determines which files will be selected
newContentResource:
string | boolean | RegExp | ((context: BeforeContextResolveData | AfterContextResolveData) => void)A new resource to replace the match
newContentRecursive:
boolean | RegExp | NewContentCreateContextMapIf true, all subdirectories are searched for matches
newContentRegExp:
RegExpA regular expression that determines which files will be selected
Returns:
ContextReplacementPluginCreates an instance of ContextReplacementPlugin.
Attributes
newContentCallback:
(context: BeforeContextResolveData | AfterContextResolveData) => voidnewContentCreateContextMap:
(fs: InputFileSystem, callback: (err: Error | null, newContentRecursive: NewContentCreateContextMap) => void) => voidStores new content create context map.
newContentRecursive:
booleannewContentRegExp:
RegExpnewContentResource:
stringresourceRegExp:
RegExpapply(compiler): voidAttributes
Applies the plugin by registering its hooks on the compiler.
[index: {string}]string