From 9e7d875195aef33ea8f30401862b441a06a88a14 Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Tue, 24 Oct 2023 17:31:12 +0100 Subject: [PATCH] use require.resolve for node resolving (to support exports) --- packages/core/src/module-resolver.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/core/src/module-resolver.ts b/packages/core/src/module-resolver.ts index 100fc91a0..8c4f475d6 100644 --- a/packages/core/src/module-resolver.ts +++ b/packages/core/src/module-resolver.ts @@ -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 { @@ -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) {