chushihua
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
class ContextExclusionPlugin {
|
||||
constructor(negativeMatcher) {
|
||||
this.negativeMatcher = negativeMatcher;
|
||||
}
|
||||
|
||||
apply(compiler) {
|
||||
compiler.plugin("context-module-factory", (cmf) => {
|
||||
cmf.plugin("context-module-files", (files) => {
|
||||
return files.filter(filePath => !this.negativeMatcher.test(filePath));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ContextExclusionPlugin;
|
||||
Reference in New Issue
Block a user