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(cli): rebuild if process.env changes in nuxt.config #8200

Merged
merged 2 commits into from Oct 14, 2020
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Oct 13, 2020

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Fixes #8199 using two methods:

  • Adding config.env in snapshot for quick diff
  • Static analyzes of process.env.* usage in nuxt.config and also include in snapshot

NOTE: Downside is that it may cause rebuilds if runtimeConfig is using process.env directly. Workaround would be using foo: 'FOO' syntax.

ThanksPic

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@pi0 pi0 requested review from Atinux and clarkdo October 13, 2020 19:37
@codecov-io
Copy link

Codecov Report

Merging #8200 into dev will decrease coverage by 0.12%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #8200      +/-   ##
==========================================
- Coverage   68.89%   68.76%   -0.13%     
==========================================
  Files          91       91              
  Lines        3851     3858       +7     
  Branches     1049     1050       +1     
==========================================
  Hits         2653     2653              
- Misses        973      979       +6     
- Partials      225      226       +1     
Flag Coverage Δ
#unittests 68.76% <0.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/cli/src/utils/generate.js 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5842a64...683d272. Read the comment docs.

@pi0 pi0 merged commit d9f4822 into dev Oct 14, 2020
@pi0 pi0 deleted the fix/env-rebuild branch October 14, 2020 08:30
@pi0 pi0 mentioned this pull request Oct 14, 2020
@LordGaav
Copy link

LordGaav commented Apr 9, 2021

I'm running into the downside you mention:

NOTE: Downside is that it may cause rebuilds if runtimeConfig is using process.env directly. Workaround would be using foo: 'FOO' syntax.

What does "foo: 'FOO' syntax." mean? My nuxt.config.js uses a syntax like such:

publicRuntimeConfig: {
  fooUrl: process.env.FOO_URL || "aSaneDefault",
}

@pi0
Copy link
Member Author

pi0 commented Apr 9, 2021

#8955 should fix this in next release to don't rebuild on env changes

@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate command will use the cache even if environment variables changed
6 participants