Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit e3a42ef

Browse files
authored
Merge pull request #725 from netlify/chore/node-env-warning
fix: warn when NODE_ENV == "production"
2 parents a894efb + bfbdb67 commit e3a42ef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

run-build-functions.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@ install_dependencies() {
506506

507507
if [ -f package.json ]
508508
then
509+
if [ "$NODE_ENV" == "production" ]
510+
then
511+
warn "The environment variable 'NODE_ENV' is set to 'production'. Any 'devDependencies' in package.json will not be installed"
512+
fi
513+
509514
if [ "$NETLIFY_USE_YARN" = "true" ] || ([ "$NETLIFY_USE_YARN" != "false" ] && [ -f yarn.lock ])
510515
then
511516
run_yarn $YARN_VERSION
@@ -888,3 +893,7 @@ unset_go_import_path() {
888893
unlink $GOPATH/src/$GO_IMPORT_PATH
889894
fi
890895
}
896+
897+
warn() {
898+
echo "WARNING: $1"
899+
}

0 commit comments

Comments
 (0)