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(command-build): allow setting context via CONTEXT env, default to production #4040
Conversation
π Benchmark resultsComparing with 41494be Package size: 355 MBβ¬οΈ 0.00% decrease vs. 41494be
Legend
|
context: | ||
options.context || | ||
process.env.CONTEXT || | ||
(['dev', 'dev:exec', 'dev:trace'].includes(this.name()) ? 'dev' : undefined), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously done in an oclif
child class, not sure if there's a better way to do it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think either. I would add a small comment here in the code to outline why we are checking for ((['dev', 'dev:exec', 'dev:trace']
to help our future selfs when touching this code again π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, done in 7ba6367
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests and having further safety nets :)
context: | ||
options.context || | ||
process.env.CONTEXT || | ||
(['dev', 'dev:exec', 'dev:trace'].includes(this.name()) ? 'dev' : undefined), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think either. I would add a small comment here in the code to outline why we are checking for ((['dev', 'dev:exec', 'dev:trace']
to help our future selfs when touching this code again π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for adding the comment! π
π Thanks for submitting a pull request! π
Summary
Fixes #4039
this.name()
is always defined, so it overrides the environment variable (which is evaluated in@netlify/config
). Also@netlify/config
defaults toproduction
context, so we should passundefined
to allow the default behavior.For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)