-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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): prevent production install on add cmd #8870
fix(cli): prevent production install on add cmd #8870
Conversation
🦋 Changeset detectedLatest commit: d5afe62 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/astro/src/cli/add/index.ts
Outdated
@@ -700,7 +700,7 @@ async function tryToInstallIntegrations({ | |||
...inheritedFlags, | |||
...installCommand.dependencies, | |||
], | |||
{ cwd } | |||
{ cwd, env: { NODE_ENV: 'development' } } |
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.
Interesting! We actually set the NODE_ENV
here so the config file is loaded correctly:
astro/packages/astro/src/cli/index.ts
Line 127 in 0d4922d
process.env.NODE_ENV = cmd === 'dev' ? 'development' : 'production'; |
On this line, could we set NODE_ENV: undefined
instead to reset the value? Also would be great to add an additional comment explaining why we need it.
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.
the reset seems to work with undefined
.
i also added a comment to explain why we are doing this 👍
5c1ac7c
to
087e8ce
Compare
Can’t wait for this PR to be merged |
@xstevenyung can you add a changeset via |
087e8ce
to
a1669c1
Compare
added the changeset as a minor bump |
Changes
NODE_ENV=development
on installation command run when usingastro add
command to prevent installation to removedevDependencies
Testing
no real way to test
Docs
no need
fix #8037