From 1b6a93f3efa1d8a4e9e04beda1a5545770e9fb07 Mon Sep 17 00:00:00 2001 From: Chance Snow Date: Fri, 22 Jun 2018 22:03:15 -0700 Subject: [PATCH] Set user provided NODE_ENV if provided with build command, fixes #702 (#1600) Like others in #702, there are times when I need a development build. This change remedies that by using the `NODE_ENV` set by a user in the build command, but will default to `production` is none is provided. --- src/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.js b/src/cli.js index 6bde994d052..242095c25db 100755 --- a/src/cli.js +++ b/src/cli.js @@ -174,7 +174,7 @@ async function bundle(main, command) { const Bundler = require('../'); if (command.name() === 'build') { - process.env.NODE_ENV = 'production'; + process.env.NODE_ENV = process.env.NODE_ENV || 'production'; } else { process.env.NODE_ENV = process.env.NODE_ENV || 'development'; }