diff --git a/lib/utils/get-matched-rule-4.js b/lib/utils/get-matched-rule-4.js index 5d5e108..8b8c0d8 100644 --- a/lib/utils/get-matched-rule-4.js +++ b/lib/utils/get-matched-rule-4.js @@ -1,4 +1,13 @@ /* eslint-disable import/no-unresolved */ +const path = require('path'); + +const ruleSetDir = path.dirname(require.resolve('webpack/lib/RuleSet')); +const webpackDir = path.dirname(require.resolve('webpack')); + +if (ruleSetDir !== webpackDir) { + throw new Error('RuleSet not found in local webpack installation'); +} + // eslint-disable-next-line import/no-extraneous-dependencies const RuleSet = require('webpack/lib/RuleSet');