aboutsummaryrefslogtreecommitdiff
path: root/node_modules/webpack/lib/ContextExclusionPlugin.js
blob: db6c81b278addb895b6b97a15bd55b15d02fb600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;