Skip to content

Commit

Permalink
fix(ruleset-migrator): use module for require.resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
dweber019 committed Feb 20, 2023
1 parent 97134a5 commit 6b1c21b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ruleset-migrator/src/requireResolve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { createRequire } from 'module';

export default <NodeRequire['resolve'] | null>((id, opts) => {
try {
return require.resolve(id, opts);
const req = createRequire(process.cwd());
return req.resolve(id, opts);
} catch {
return null;
}
Expand Down

0 comments on commit 6b1c21b

Please sign in to comment.