diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/webpack/lib/ContextExclusionPlugin.js | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/webpack/lib/ContextExclusionPlugin.js')
-rw-r--r-- | node_modules/webpack/lib/ContextExclusionPlugin.js | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/node_modules/webpack/lib/ContextExclusionPlugin.js b/node_modules/webpack/lib/ContextExclusionPlugin.js index db6c81b27..0b1dda0e9 100644 --- a/node_modules/webpack/lib/ContextExclusionPlugin.js +++ b/node_modules/webpack/lib/ContextExclusionPlugin.js @@ -1,17 +1,28 @@ -"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;
+"use strict"; + +/** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./ContextModuleFactory")} ContextModuleFactory */ + +class ContextExclusionPlugin { + /** + * @param {RegExp} negativeMatcher Matcher regular expression + */ + constructor(negativeMatcher) { + this.negativeMatcher = negativeMatcher; + } + + /** + * Apply the plugin + * @param {Compiler} compiler Webpack Compiler + * @returns {void} + */ + apply(compiler) { + compiler.hooks.contextModuleFactory.tap("ContextExclusionPlugin", cmf => { + cmf.hooks.contextModuleFiles.tap("ContextExclusionPlugin", files => { + return files.filter(filePath => !this.negativeMatcher.test(filePath)); + }); + }); + } +} + +module.exports = ContextExclusionPlugin; |