Skip to content

Commit

Permalink
use require.resolve for node resolving (to support exports)
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Nov 21, 2023
1 parent a92d9a2 commit 35d2329
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/core/src/module-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type { Package, V2Package } from '@embroider/shared-internals';
import { explicitRelative, RewrittenPackageCache } from '@embroider/shared-internals';
import makeDebug from 'debug';
import assertNever from 'assert-never';
import resolveModule from 'resolve';
import reversePackageExports from '@embroider/reverse-exports';

import {
Expand Down Expand Up @@ -286,9 +285,8 @@ export class Resolver {
};
}
try {
let filename = resolveModule.sync(request.specifier, {
basedir: dirname(request.fromFile),
extensions: this.options.resolvableExtensions,
let filename = require.resolve(request.specifier, {
paths: [dirname(request.fromFile)],
});
return { type: 'found', result: { type: 'real' as 'real', filename } };
} catch (err) {
Expand Down

0 comments on commit 35d2329

Please sign in to comment.