nuxt / cli

⚡️ Nuxt Generation CLI Experience.
https://github.com/nuxt/cli/discussions/3
MIT License
267 stars 65 forks source link

Bun ignores `--dotenv` option #301

Open ahas opened 11 months ago

ahas commented 11 months ago

Environment

Reproduction

  1. Create multiple .env files: .env.local, .env.dev, .env.prod.
  2. Add --dotenv .env.dev to the dev command in package.json > scripts. For example: "dev": "nuxt dev --dotenv .env.dev" Even if executed with bunx nuxt dev --dotenv .env.dev, the result is the same.
  3. Write code that utilizes values from the .env.dev file, execute the dev command, and check the result.

Describe the bug

When running Nuxt with Bun, the --dotenv option does not work as specified. If both .env.local and .env.dev files are created, it seems that the .env.local file is read with priority.

Additional context

No response

Logs

No response

danielroe commented 11 months ago

This is likely due to a Bun-specific behaviour rather than Nuxt.