File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 22
33- Fix runtime signature cache invalidation
44- Provide error messaging for un-downloadable binaries
5+ - Default to NODE_ENV=production for both build and runtime
56
67## v77
78
Original file line number Diff line number Diff line change @@ -2,12 +2,19 @@ create_default_env() {
22 export NPM_CONFIG_PRODUCTION=${NPM_CONFIG_PRODUCTION:- true}
33 export NPM_CONFIG_LOGLEVEL=${NPM_CONFIG_LOGLEVEL:- error}
44 export NODE_MODULES_CACHE=${NODE_MODULES_CACHE:- true}
5+ export NODE_ENV=${NODE_ENV:- production}
56}
67
78list_node_config () {
89 echo " "
910 printenv | grep ^NPM_CONFIG_ || true
1011 printenv | grep ^NODE_ || true
12+
13+ if [ " $NPM_CONFIG_PRODUCTION " = " true" ] && [ " $NODE_ENV " != " production" ]; then
14+ echo " "
15+ echo " npm scripts will see NODE_ENV=production (not '${NODE_ENV} ')"
16+ echo " https://docs.npmjs.com/misc/config#production"
17+ fi
1118}
1219
1320export_env_dir () {
Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ calculate_concurrency() {
1010 WEB_CONCURRENCY=$WEB_CONCURRENCY
1111}
1212
13- log_concurrency () {
14- echo " Detected $MEMORY_AVAILABLE MB available memory, $WEB_MEMORY MB limit per process (WEB_MEMORY)"
15- echo " Recommending WEB_CONCURRENCY=$WEB_CONCURRENCY "
16- }
17-
1813detect_memory () {
1914 local default=$1
2015 local limit=$( ulimit -u)
@@ -29,9 +24,9 @@ detect_memory() {
2924
3025export PATH=" $HOME /.heroku/node/bin:$HOME /bin:$HOME /node_modules/.bin:$PATH "
3126export NODE_HOME=" $HOME /.heroku/node"
27+ export NODE_ENV=${NODE_ENV:- production}
3228
3329calculate_concurrency
34- log_concurrency
3530
3631export MEMORY_AVAILABLE=$MEMORY_AVAILABLE
3732export WEB_MEMORY=$WEB_MEMORY
You can’t perform that action at this time.
0 commit comments