Skip to content

Commit 41811df

Browse files
committed
fix(build): fixed compiling JavaScript files
1 parent dbeafef commit 41811df

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

gulpfile.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ var fnCacheTpls = function (path) {
112112
gulp.task('scripts:cacheTpls', function () {
113113
return fnCacheTpls(config.paths.templates);
114114
});
115+
gulp.task('scripts:ngmin', ['scripts:cacheTpls'], function () {
116+
return gulp.src(config.paths.scripts)
117+
.pipe(plugins.ngmin())
118+
.pipe(plugins.concat(pkg.name + '-' + pkg.version + '.js'))
119+
.pipe(gulp.dest(config.build + '/assets'));
120+
});
115121

116122
// Check JavaScript code quality with JSHint
117123
var fnLint = function (path, exitOnError) {
@@ -132,13 +138,13 @@ gulp.task('scripts:lint', function () {
132138
});
133139

134140
// Concat and minify JavaScript
135-
gulp.task('scripts', ['scripts:lint', 'scripts:cacheTpls', 'vendor:js'], function () {
136-
var arr = (config.vendor_files.js).concat(config.paths.scripts, config.build + '/app/templates.js');
141+
gulp.task('scripts', ['scripts:lint', 'scripts:ngmin', 'vendor:js'], function () {
142+
var arr = (config.vendor_files.js).concat([config.build + '/assets/' + pkg.name + '-' + pkg.version + '.js', config.build + '/app/templates.js']);
137143
return gulp.src(arr)
138144
.pipe(plugins.concat(pkg.name + '-' + pkg.version + '.js'))
139145
.pipe(plugins.size({ showFiles: true, title: '[JS]' }))
140-
.pipe(plugins.ngmin())
141146
.pipe(plugins.uglify({
147+
mangle: false,
142148
compress: {
143149
drop_console: true
144150
}

0 commit comments

Comments
 (0)