Skip to content

Commit

Permalink
added the ability to set environment in when running build, defaultin…
Browse files Browse the repository at this point in the history
…g to production
  • Loading branch information
kentandersen committed Nov 30, 2017
1 parent 6b1e9a1 commit 222cbdb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
process.env.BABEL_ENV = process.env.BABEL_ENV || process.env.NODE_ENV;

// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
Expand Down Expand Up @@ -82,7 +82,7 @@ measureFileSizesBeforeBuild(paths.appBuild)

// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
console.log('Creating an optimized production build...');
console.log(`Creating an optimized ${process.env.NODE_ENV} build...`);

const compiler = webpack(config);
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 222cbdb

Please sign in to comment.