-
Notifications
You must be signed in to change notification settings - Fork 78
fix(node.js) Update documentation related to devDependencies pruning #3326
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
base: master
Are you sure you want to change the base?
Changes from all commits
2bde28d
d7db0a5
4c12a14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,22 +96,11 @@ environment. | |
|
|
||
| By default, dependencies present in the `devDependencies` field are installed. At the end of the deployment, `devDependencies` are pruned. Hence only production dependencies are left in the image used for the runtime. | ||
|
|
||
| The pruning step can be skipped by setting the environment variable `YARN_PRODUCTION` to any value. | ||
| `devDependencies` can be totally ignored and not installed at all by setting `NPM_CONFIG_PRODUCTION=true` npm or `YARN_PRODUCTION=true` with yarn v1. | ||
|
|
||
| #### Skip Pruning | ||
|
|
||
| If you need access to packages declared under devDependencies at runtime or in a different buildpack then, depending on the package manager used, you can set one of the following environment variables to skip the pruning step: | ||
|
|
||
| | Package manager | Version | Environment variable | Value | | ||
| |-----------------|---------|-------------------------|---------| | ||
| | npm | Any | `NPM_CONFIG_PRODUCTION` | `true` | | ||
| | yarn | v1 | `YARN_PRODUCTION` | `true` | | ||
| | yarn | v2+ | `YARN2_SKIP_PRUNING` | `true` | | ||
|
|
||
|
|
||
| Then you can use this CLI command pattern: `scalingo --app my-app env-set variable=value` | ||
|
|
||
| Example for npm : `scalingo --app my-app env-set NPM_CONFIG_PRODUCTION=true` | ||
| If you need access to packages declared under `devDependencies` at runtime - or in a different buildpack - then you'll need to use yarn v2+ and set `YARN2_SKIP_PRUNING=true`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not keen on this change. I don't think we want to force customers to use Yarn if they need to access dependencies declared in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no other alternative right now |
||
|
|
||
| ### Ensure you're Tracking all your Dependencies | ||
|
|
||
|
|
||
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 think this section should highlight the type of errors a customer may face, and link to
languages/nodejs/2000-01-01-start#devdependencies-installationto explain how to circumvent them.