-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
No way to get production dependencies without NODE_ENV=production #465
Comments
Hi! If you set
|
Yes but as I wrote in the description this changes the NODE_ENV, which has effects on the post build script, since the env will now always be production. I find it a bit strange that the way to get not get dev dependencies is to overwrite the NODE_ENV, instead of just using the --production flag. |
My team has also been having this issue as we have a staging dyno that builds our slug before we promote that slug to production. And we didn't want the devDependencies to be included in the slug, so we set For now we've had to use a separate environment variable I've looked through this repo and couldn't immediately find where/how the npm install command is run, but would it be possible to have an env variable that either sets |
In our staging environment we would like to use NODE_ENV=staging, but still only get production dependencies installed. That does not seem possible with the buildpack.
We use https://www.npmjs.com/package/config to manage configuration, which is based on NODE_ENV. This needs to be set correctly during install, as we use
heroku-postbuild
package script to compile bundles, and this depends on the configuration.The text was updated successfully, but these errors were encountered: