From fe1e7f175cc8d9e7b65224f5dc47a7fd7e3ea751 Mon Sep 17 00:00:00 2001 From: Jonathan Niles Date: Fri, 24 Feb 2017 15:47:23 +0100 Subject: [PATCH] fix(build): build in development mode This commit fixes a bug with the gulp build that does not register the correct build environment for setting the angular debug flags. Previously, it was always true. --- client/src/index.html | 6 +++--- gulpfile.js | 3 ++- package.json | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/src/index.html b/client/src/index.html index 2f0ffbc95f..54c425ec73 100644 --- a/client/src/index.html +++ b/client/src/index.html @@ -110,9 +110,9 @@

{{ AppCtrl.project.name }}< diff --git a/gulpfile.js b/gulpfile.js index bf26d4456f..2f66973bf3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -26,6 +26,7 @@ const exec = require('child_process').exec; // toggle client javascript minification const isProduction = (process.env.NODE_ENV === 'production'); +const isDevelopment = (process.env.NODE_ENV !== 'production'); // the output folder for built server files const SERVER_FOLDER = './bin/server/'; @@ -240,7 +241,7 @@ gulp.task('client-compute-hashes', ['client-compile-js', 'client-compile-vendor' gulp.task('client-compile-assets', ['client-mv-static', 'client-compute-hashes'], () => gulp.src(paths.client.index) - .pipe(template({ isProduction: true })) + .pipe(template({ isProduction, isDevelopment })) .pipe(revReplace({ manifest: gulp.src(`${CLIENT_FOLDER}${MANIFEST_PATH}`) })) .pipe(gulp.dest(CLIENT_FOLDER)) ); diff --git a/package.json b/package.json index 232ee9d788..d2f3386de7 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "A rural hospital information management system.", "main": "sh/deploy.sh", "scripts": { - "app": "gulp build && cd bin && NODE_ENV=production node server/app.js", - "dev": "gulp build && cd bin && NODE_ENV=development node server/app.js", + "app": "NODE_ENV=production gulp build && cd bin && NODE_ENV=production node server/app.js", + "dev": "NODE_ENV=development gulp build && cd bin && NODE_ENV=development node server/app.js", "start": "sh/deploy.sh", "karma": "./node_modules/.bin/karma start --single-run --no-auto-watch --concurrency 1 karma.conf.js", "lint": "./sh/lint.sh",