Skip to content

Commit

Permalink
fix: not use default
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Nov 8, 2022
1 parent ddc11bd commit 4a1d184
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/vite/src/node/env.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'node:fs'
import dotenv, { config } from 'dotenv'
import { config, parse } from 'dotenv'
import { expand } from 'dotenv-expand'
import { arraify, lookupFile } from './utils'
import type { UserConfig } from './config'
Expand Down Expand Up @@ -35,7 +35,13 @@ export function loadEnv(
rootDir: envDir
})
if (!path) return []
return Object.entries(dotenv.parse(fs.readFileSync(path)))
try {
return Object.entries(parse(fs.readFileSync(path)))
} catch (err) {
throw new Error(
`Multiple entry points are not supported when output formats include "umd" or "iife".`
)
}
})
)

Expand Down

0 comments on commit 4a1d184

Please sign in to comment.