Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 79ba70d

Browse files
fix: import extensionless dependency file (#27)
1 parent fb4357e commit 79ba70d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/loaders.ts

-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ export const resolve: resolve = async function (
143143
} catch (error) {
144144
if (
145145
(error instanceof Error)
146-
&& isPath
147146
&& !recursiveCall
148147
) {
149148
if ((error as any).code === 'ERR_UNSUPPORTED_DIR_IMPORT') {

tests/specs/typescript/dependencies.ts

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
1111
expect(nodeProcess.stdout).toBe(output);
1212
});
1313

14+
test('Import extensionless', async () => {
15+
const nodeProcess = await node.import('package-module/ts');
16+
expect(nodeProcess.stdout).toBe(output);
17+
});
18+
1419
test('Import', async () => {
1520
const nodeProcess = await node.import('package-typescript-export');
1621
expect(nodeProcess.stdout).toBe(output);

0 commit comments

Comments
 (0)