new ContextReplacementPlugin(resourceRegExp, newContentResource?, newContentRecursive?, newContentRegExp?): ContextReplacementPlugin
Attributes
resourceRegExp:
RegExpnewContentResource:
string | boolean | RegExp | ((context: BeforeContextResolveData | AfterContextResolveData) => void)newContentRecursive:
boolean | RegExp | NewContentCreateContextMapnewContentRegExp:
RegExpReturns:
ContextReplacementPluginCreates an instance of ContextReplacementPlugin.
contextReplacementPlugin.newContentCallback(context): void
Attributes
contextReplacementPlugin.newContentCreateContextMap(fs, callback): void
Attributes
callback:
(err: Error | null, newContentRecursive: NewContentCreateContextMap) => voidStores new content create context map.
Type:
booleanType:
RegExpType:
stringType:
RegExpcontextReplacementPlugin.apply(compiler): void
Attributes
compiler:
CompilerApplies the plugin by registering its hooks on the compiler.