From d5f14083061f2ce6a42313188443a42e30796320 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 31 Oct 2023 15:37:35 +0800 Subject: added make browserlist(autoprefixer) work fixed --- node_modules/webpack/lib/ContextExclusionPlugin.js | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 node_modules/webpack/lib/ContextExclusionPlugin.js (limited to 'node_modules/webpack/lib/ContextExclusionPlugin.js') diff --git a/node_modules/webpack/lib/ContextExclusionPlugin.js b/node_modules/webpack/lib/ContextExclusionPlugin.js new file mode 100644 index 00000000..da51e30b --- /dev/null +++ b/node_modules/webpack/lib/ContextExclusionPlugin.js @@ -0,0 +1,32 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"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 the compiler instance + * @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