We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
process.argv[1]
1 parent 4f44046 commit b60a3c2Copy full SHA for b60a3c2
packages/node/src/module.ts
@@ -10,7 +10,7 @@ function normalizeWindowsPath(path: string): string {
10
11
/** Creates a function that gets the module name from a filename */
12
export function createGetModuleFromFilename(
13
- basePath: string = dirname(process.argv[1]),
+ basePath: string = process.argv[1] ? dirname(process.argv[1]) : process.cwd(),
14
isWindows: boolean = sep === '\\',
15
): (filename: string | undefined) => string | undefined {
16
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
0 commit comments