Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix: restore check
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jul 25, 2022
1 parent cf399a5 commit 3ca201f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/nuxi/src/commands/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ export default defineNuxtCommand({
process.exit(1)
}

consola.info('Loading `.env`. This will not be loaded when running the server in production.')
await setupDotenv({ cwd: rootDir })
if (existsSync(resolve(rootDir, '.env'))) {
consola.info('Loading `.env`. This will not be loaded when running the server in production.')
await setupDotenv({ cwd: rootDir })
}

consola.info('Starting preview command:', nitroJSON.commands.preview)
const [command, ...commandArgs] = nitroJSON.commands.preview.split(' ')
Expand Down

0 comments on commit 3ca201f

Please sign in to comment.