Skip to content

Commit

Permalink
fix(build): build in development mode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jonathan Niles committed Feb 24, 2017
1 parent 4481b19 commit fe1e7f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ <h4><a class="title-content" ui-sref="index.details">{{ AppCtrl.project.name }}<
<!-- this is templated in with variables from gulp-template -->
<script>
angular.module('bhima')
.config(['$compileProvider', function ($compileProvider) {
$compileProvider.debugInfoEnabled(<%= isProduction %>);
}])
.config(['$compileProvider', function ($compileProvider) {
$compileProvider.debugInfoEnabled(<%= isDevelopment %>);
}])
</script>

</body>
Expand Down
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/';
Expand Down Expand Up @@ -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))
);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit fe1e7f1

Please sign in to comment.