项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

18 lines
401 B

  1. "use strict";
  2. class ContextExclusionPlugin {
  3. constructor(negativeMatcher) {
  4. this.negativeMatcher = negativeMatcher;
  5. }
  6. apply(compiler) {
  7. compiler.plugin("context-module-factory", (cmf) => {
  8. cmf.plugin("context-module-files", (files) => {
  9. return files.filter(filePath => !this.negativeMatcher.test(filePath));
  10. });
  11. });
  12. }
  13. }
  14. module.exports = ContextExclusionPlugin;