Skip to content

Commit

Permalink
use envify to disable debug info when building for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemmarsh committed Jun 6, 2016
1 parent 99fd028 commit 0a6aad6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 5 additions & 1 deletion app/js/on_config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
function OnConfig($stateProvider, $locationProvider, $urlRouterProvider) {
function OnConfig($stateProvider, $locationProvider, $urlRouterProvider, $compileProvider) {
'ngInject';

if (process.env.NODE_ENV === 'production') {
$compileProvider.debugInfoEnabled(false);
}

$locationProvider.html5Mode(true);

$stateProvider
Expand Down
2 changes: 1 addition & 1 deletion app/js/on_run.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function OnRun($rootScope, AppSettings) {
$rootScope.$on('$stateChangeSuccess', (event, toState) => {
$rootScope.pageTitle = '';

if ( toState.title ) {
if (toState.title) {
$rootScope.pageTitle += toState.title;
$rootScope.pageTitle += ' \u2014 ';
}
Expand Down
13 changes: 8 additions & 5 deletions gulp/tasks/browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import uglify from 'gulp-uglify';
import browserSync from 'browser-sync';
import debowerify from 'debowerify';
import ngAnnotate from 'browserify-ngannotate';
import bulkify from 'bulkify';
import envify from 'envify';
import handleErrors from '../util/handleErrors';
import bundleLogger from '../util/bundleLogger';
import config from '../config';
Expand All @@ -37,11 +39,12 @@ function buildScript(file) {
}

const transforms = [
{ 'name':babelify, 'options': {}},
{ 'name':debowerify, 'options': {}},
{ 'name':ngAnnotate, 'options': {}},
{ 'name':'brfs', 'options': {}},
{ 'name':'bulkify', 'options': {}}
{ name: babelify, options: {} },
{ name: debowerify, options: {} },
{ name: ngAnnotate, options: {} },
{ name: 'brfs', options: {} },
{ name: bulkify, options: {} },
{ name: envify, options: {} }
];

transforms.forEach(function(transform) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"bulkify": "^1.1.1",
"debowerify": "^1.3.1",
"del": "^2.1.0",
"envify": "^3.4.0",
"eslint": "2.2.0",
"express": "^4.13.3",
"gulp": "^3.9.0",
Expand Down

0 comments on commit 0a6aad6

Please sign in to comment.