Skip to content

Commit

Permalink
fix(utils): force get-matched-rule-4 to use nearest webpack installat…
Browse files Browse the repository at this point in the history
…ion (#463)
  • Loading branch information
protango committed Jun 23, 2021
1 parent c94cec8 commit dcaa65a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 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');

Expand Down

0 comments on commit dcaa65a

Please sign in to comment.