From 35d2329cda65af7cc2c505b897c6f1fedd35a298 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 73e1a6660..2dcde265d 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 '@embroider/reverse-exports'; import { @@ -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) {