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(env): test NODE_ENV override before expand #11309

Merged
merged 3 commits into from
Dec 12, 2022
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Dec 11, 2022

Description

fix #11302

Repro https://stackblitz.com/edit/vitejs-vite-ksgf5q?file=package.json&terminal=build (incorrect build warning)

If process.env.NODE_ENV is already set e.g. production, and there's a NODE_ENV=development in the .env file. dotenv-expand would override as NODE_ENV=production, making the NODE_ENV=development check fail.

This PR handles NODE_ENV before expand.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added the p4-important Violate documented behavior or significantly improves performance (priority) label Dec 11, 2022
@bluwy

This comment was marked as outdated.

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Dec 11, 2022

📝 Ran ecosystem CI: Open

suite result
astro ✅ success
histoire ✅ success
iles ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt-framework ❌ failure
previewjs ✅ success
rakkas ✅ success
sveltekit ❌ failure
vite-plugin-ssr ✅ success
vite-plugin-react ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ❌ failure
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ❌ failure
windicss ✅ success

@bluwy
Copy link
Member Author

bluwy commented Dec 11, 2022

Besides vite-plugin-svelte, the failing ones seem to have unrelated issue to this PR. I'm not sure why vite-plugin-svelte is failing though, might need help on that as I'll be away this week, but I don't think the changes here would've affected it from the top of my head.

@patak-dev
Copy link
Member

@benmccann @dominikg would you check if we can include this PR in a patch?

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Dec 12, 2022

📝 Ran ecosystem CI: Open

suite result
astro ✅ success
histoire ✅ success
iles ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt-framework ✅ success
previewjs ✅ success
rakkas ✅ success
sveltekit ✅ success
vite-plugin-ssr ✅ success
vite-plugin-react ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ✅ success
windicss ✅ success

@patak-dev patak-dev merged commit d0a9281 into main Dec 12, 2022
@patak-dev patak-dev deleted the fix-env-node-env branch December 12, 2022 15:12
futurGH pushed a commit to futurGH/vite that referenced this pull request Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Library mode does not respect the --mode flag
2 participants