Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev,preview): correctly infer .env filename from --dotenv arg #381

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

DamianGlowala
Copy link
Member

resolves #360

This corrects types for the --dotenv flag and sets the default value at source.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will running npx nuxi preview --dotenv continue to work as expected (ie. a non-breaking change)?

@DamianGlowala DamianGlowala changed the title fix(dev): correctly apply --dotenv arg fix(dev,preview): correctly apply --dotenv arg May 10, 2024
@DamianGlowala DamianGlowala marked this pull request as draft May 10, 2024 10:09
Copy link

pkg-pr-new bot commented Jan 11, 2025

Open in Stackblitznuxt-cli-playground

npm i https://pkg.pr.new/nuxi@381

commit: 8099a7b

Copy link

github-actions bot commented Jan 11, 2025

Bundle Stats

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
28 75.42 kB → 75.96 kB (+558 B) +0.72%
Changeset
File Δ Size
src/commands/dev-child.ts 📈 +169 B (+9.39%) 1.76 kB → 1.92 kB
src/commands/preview.ts 📈 +159 B (+5.47%) 2.84 kB → 3 kB
src/utils/dev.ts 📈 +139 B (+1.91%) 7.12 kB → 7.25 kB
src/commands/dev.ts 📈 +91 B (+1.27%) 7 kB → 7.09 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/dev-child.mjs 1.76 kB → 1.92 kB (+169 B) +9.39%
chunks/preview.mjs 2.84 kB → 3 kB (+159 B) +5.47%
chunks/dev2.mjs 7.12 kB → 7.25 kB (+139 B) +1.91%
chunks/dev.mjs 7 kB → 7.09 kB (+91 B) +1.27%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 201 B 0%
chunks/add.mjs 6.83 kB 0%
chunks/analyze.mjs 3.18 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/devtools.mjs 763 B 0%
chunks/generate.mjs 388 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/init.mjs 5.05 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 1.74 kB 0%
chunks/upgrade.mjs 5.69 kB 0%
chunks/add2.mjs 10.04 kB 0%
chunks/search.mjs 2.94 kB 0%
shared/nuxi.KWbgM7Cu.mjs 5.47 kB 0%
shared/nuxi.CconR24j.mjs 804 B 0%
shared/nuxi.p9Qemyqb.mjs 294 B 0%
shared/nuxi.BSm0_9Hr.mjs 107 B 0%
shared/nuxi.DlcAx0De.mjs 1.04 kB 0%
shared/nuxi.GA8i2PDO.mjs 1.24 kB 0%
shared/nuxi.Cxkkjbvc.mjs 1.11 kB 0%
shared/nuxi.C935N1ss.mjs 687 B 0%

@DamianGlowala DamianGlowala changed the title fix(dev,preview): correctly apply --dotenv arg fix(dev,preview): correctly infer .env filename from --dotenv arg Jan 12, 2025
@DamianGlowala DamianGlowala marked this pull request as ready for review January 12, 2025 12:53
@DamianGlowala DamianGlowala requested review from danielroe and removed request for pi0 January 12, 2025 12:54
Comment on lines +105 to +106
logger.error(`Cannot find \`${envFileName}\`.`)
process.exit(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just warn in this case?

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking, this doesn't seem to resolved the linked issue - .env is used as a the 'fallback' instead of .env.local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nuxt reads a different env file if value is not found in the configured env file
2 participants