Skip to content

Commit

Permalink
fix: should resolve env even without config file
Browse files Browse the repository at this point in the history
fix #290
  • Loading branch information
yyx990803 committed May 28, 2020
1 parent 2f071b3 commit 482bd34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ export async function resolveConfig(
}

if (!resolvedPath) {
return
// load environment variables
return {
env: loadEnv(mode, cwd)
}
}

try {
Expand Down Expand Up @@ -342,11 +345,7 @@ export async function resolveConfig(
}
}

// load environment variables
const env = loadEnv(mode, config.root || cwd)
debug(`env: %O`, env)
config.env = env

config.env = loadEnv(mode, config.root || cwd)
debug(`config resolved in ${Date.now() - start}ms`)

config.__path = resolvedPath
Expand Down Expand Up @@ -436,5 +435,6 @@ function loadEnv(mode: string, root: string): Record<string, string> {
}
}

debug(`env: %O`, env)
return env
}

0 comments on commit 482bd34

Please sign in to comment.