From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/webpack/lib/ContextExclusionPlugin.js | 45 ++++++++++++++-------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'node_modules/webpack/lib/ContextExclusionPlugin.js') 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; -- cgit v1.2.3