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

Update Webpack client variables #1607

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Dec 3, 2022

Description of proposed changes

See commit messages. I thought of these while working on #1520, but believe these changes can be made independently of the Webpack upgrade.

Tasks

  • Configure Jest to recognize the new global variable.

Related issue(s)

N/A

Testing

Based on a warning in the DefinePlugin docs¹, previous usage of a
"process.env" key has the potential to break any modules that might use
the process.env object. Luckily (so far) there is no such conflict in
this project, but good to future-proof.

¹ https://v4.webpack.js.org/plugins/define-plugin/#usage
The process.env scope is commonly used in Node.js projects to contain
variables injected from an external context. For Webpack, the scope can
be any arbitrary name.

"webpackConfig" is more self-describing and avoids potential confusion
for someone searching the codebase. Without this change, one might
suspect that `process.env.PORT` referenced in cli/ files comes from the
same source as `process.env.NODE_ENV` when that's not the case - they
are entirely independent.
@victorlin victorlin self-assigned this Dec 3, 2022
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-victorlin-updat-j7iwwr December 3, 2022 04:10 Inactive
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-victorlin-updat-j7iwwr December 3, 2022 04:35 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants