We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94be0eb commit 2c25cc1Copy full SHA for 2c25cc1
src/svelte-config/index.ts
@@ -103,10 +103,11 @@ export function resolveSvelteConfigFromOption(
103
function resolveSvelteConfig(
104
filePath: string | undefined,
105
): SvelteConfig | null {
106
- const cwd =
107
- filePath && fs.existsSync(filePath)
108
- ? path.dirname(filePath)
109
- : process.cwd();
+ let cwd = filePath && fs.existsSync(filePath) ? path.dirname(filePath) : null;
+ if (cwd == null) {
+ if (typeof process === "undefined") return null;
+ cwd = process.cwd();
110
+ }
111
const configFilePath = findConfigFilePath(cwd);
112
if (!configFilePath) return null;
113
0 commit comments