Skip to content

Commit 290e816

Browse files
committed
Fixing the minifcation. Mangling breaks angularjs.
1 parent 58ec2eb commit 290e816

File tree

4 files changed

+148
-2
lines changed

4 files changed

+148
-2
lines changed

ui/Gulpfile.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
git = require('git-rev-sync')
22
pkgVersion = require('./package.json').version
33
gulp = require('gulp')
4+
ngAnnotate = require('gulp-ng-annotate')
45
uglify = require('gulp-uglify');
56
streamify = require('gulp-streamify');
67
watch = require('gulp-watch')
@@ -102,7 +103,8 @@ scripts = (isWatch) ->
102103
.on('error', util.log.bind(util, "browserify error"))
103104
.pipe(plumber({ errorHandler }))
104105
.pipe(source('index.js'))
105-
.pipe(if isDeploy(nodeEnv) then streamify(uglify())else util.noop())
106+
.pipe(ngAnnotate())
107+
.pipe(if isDeploy(nodeEnv) then streamify(uglify({ mangle: false })) else util.noop())
106108
.pipe(buffer())
107109
.pipe(replace('COBUDGET_RELEASE_VERSION', getCobudgetVersion()))
108110
.pipe(replace('SENTRY_ENVIRONMENT', env.APP_ENV || nodeEnv))

ui/app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ concatenify('./models/*.{js,coffee}')
8585
concatenify('./filters/*.{js,coffee}')
8686
concatenify('./services/*.{js,coffee}')
8787
concatenify('./directives/**/*.{js,coffee}')
88-
88+
8989
require('app/boot.coffee')

ui/package-lock.json

Lines changed: 141 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "./server.js",
66
"browser": "./index.js",
77
"scripts": {
8+
"mini": "cd build/scripts/ ; uglifyjs index.js -c -m > index.min.js; mv index.min.js index.js",
89
"build": "NODE_ENV=production gulp build",
910
"develop": "gulp develop",
1011
"start": "gulp build && node .",
@@ -96,6 +97,7 @@
9697
"gulp-autoprefixer": "^3.1.1",
9798
"gulp-filter": "^1.0.2",
9899
"gulp-livereload": "^2.1.1",
100+
"gulp-ng-annotate": "^2.1.0",
99101
"gulp-nodemon": "^1.0.4",
100102
"gulp-plumber": "^0.6.6",
101103
"gulp-rename": "^1.2.0",
@@ -109,6 +111,7 @@
109111
"node-sass": "^4.14.1",
110112
"tiny-lr": "^0.1.4",
111113
"txtify2": "^2.0.0",
114+
"uglify-js": "^3.9.4",
112115
"vinyl-buffer": "^1.0.0",
113116
"vinyl-source-stream": "^1.0.0",
114117
"watchify": "^3.2.3"

0 commit comments

Comments
 (0)