I need to run React in production mode, which presumably entails defining the following somewhere in the enviornment:
process.env.NODE_ENV = \'production\';
Also you may use handy way with gulp-environments
:
var environments = require('gulp-environments');
var production = environments.production;
gulp.src(paths.js)
.pipe(concat("app.js"))
// only minify the compiled JS in production mode
.pipe(production(uglify()))
.pipe(gulp.dest("./public/app/js/"));
To run gulp in production mode:
gulp build --env=production