Skip to content

Commit 2c25cc1

Browse files
committed
chore: fix for explorer (take 3)
1 parent 94be0eb commit 2c25cc1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/svelte-config/index.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ export function resolveSvelteConfigFromOption(
103103
function resolveSvelteConfig(
104104
filePath: string | undefined,
105105
): SvelteConfig | null {
106-
const cwd =
107-
filePath && fs.existsSync(filePath)
108-
? path.dirname(filePath)
109-
: process.cwd();
106+
let cwd = filePath && fs.existsSync(filePath) ? path.dirname(filePath) : null;
107+
if (cwd == null) {
108+
if (typeof process === "undefined") return null;
109+
cwd = process.cwd();
110+
}
110111
const configFilePath = findConfigFilePath(cwd);
111112
if (!configFilePath) return null;
112113

0 commit comments

Comments
 (0)