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 6, 2023
1 parent 3a3a8fb commit 9e7d875
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 'reverse-exports';

import {
Expand Down Expand Up @@ -279,9 +278,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 9e7d875

Please sign in to comment.