Skip to content

Commit dcaa65a

Browse files
authored
fix(utils): force get-matched-rule-4 to use nearest webpack installation (#463)
1 parent c94cec8 commit dcaa65a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/utils/get-matched-rule-4.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
/* eslint-disable import/no-unresolved */
2+
const path = require('path');
3+
4+
const ruleSetDir = path.dirname(require.resolve('webpack/lib/RuleSet'));
5+
const webpackDir = path.dirname(require.resolve('webpack'));
6+
7+
if (ruleSetDir !== webpackDir) {
8+
throw new Error('RuleSet not found in local webpack installation');
9+
}
10+
211
// eslint-disable-next-line import/no-extraneous-dependencies
312
const RuleSet = require('webpack/lib/RuleSet');
413

0 commit comments

Comments
 (0)