From a98695e8ce839f133cf7a814a53f2bc3df8d5cd6 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 16 Nov 2015 10:06:21 +0100 Subject: upgrade react to 0.14.2, use production build --- server/sonar-web/gulpfile.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'server/sonar-web/gulpfile.js') diff --git a/server/sonar-web/gulpfile.js b/server/sonar-web/gulpfile.js index 6ef301b1fb8..03f2e607b80 100644 --- a/server/sonar-web/gulpfile.js +++ b/server/sonar-web/gulpfile.js @@ -4,16 +4,22 @@ var del = require('del'); var gulp = require('gulp'); var gutil = require('gulp-util'); +var env = require('gulp-env'); var argv = require('yargs').argv; var production = !argv.dev && !argv.fast; var dev = !!argv.dev && !argv.fast; var output = argv.output || './src/main/webapp'; +var nodeEnv = production ? 'production' : 'development'; var styles = require('./gulp/styles').styles; var scripts = require('./gulp/scripts'); +gulp.task('set-env', function () { + env({ vars: { 'NODE_ENV': nodeEnv } }); +}); + gulp.task('scripts-sonar', function () { return scripts.sonar(output, production); }); @@ -62,4 +68,4 @@ gulp.task('watch', ['scripts-main-watch', 'scripts-apps-watch', 'scripts-widgets gutil.log(gutil.colors.bgGreen('Watching for changes...')); }); -gulp.task('default', ['build']); \ No newline at end of file +gulp.task('default', ['set-env', 'build']); -- cgit v1.2.3