Skip to content

Commit 92a3bbf

Browse files
authored
fix(register): default TSCONFIG_PATH on windows. (#818)
1 parent f6735ab commit 92a3bbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/register/esm.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
type ResolveHook,
88
builtinModules,
99
} from 'node:module'
10-
import { extname, join } from 'node:path'
10+
import { extname, isAbsolute, join } from 'node:path'
1111
import { fileURLToPath, parse as parseUrl, pathToFileURL } from 'node:url'
1212

1313
import debugFactory from 'debug'
@@ -29,7 +29,7 @@ tsconfig.module = ts.ModuleKind.ESNext
2929
const TSCONFIG_PATH = (function () {
3030
const pathFromEnv =
3131
process.env.SWC_NODE_PROJECT ?? process.env.TS_NODE_PROJECT ?? join(process.cwd(), 'tsconfig.json')
32-
if (!pathFromEnv.startsWith('/')) {
32+
if (!isAbsolute(pathFromEnv)) {
3333
return join(process.cwd(), pathFromEnv)
3434
}
3535
return pathFromEnv

0 commit comments

Comments
 (0)