My current approach involves using gulp-uglify
and gulp-concat
to minify and concatenate my JavaScript files. The specific code for this process is outlined below:
gulp.task('scripts', function() {
gulp.src([
'./development/assets/js/lib/jquery-1.11.2.min.js',
'./development/assets/js/lib/foundation.min.js',
'./development/assets/js/lib/angular.min.js',
'./development/assets/js/lib/angular.min.js.map',
'./development/assets/js/lib/angular-ui-router.min.js',
'./development/assets/js/lib/angular-animate.js',
'./development/assets/js/lib/angular-sanitize.min.js',
'./development/assets/js/lib/loading-bar.min.js',
'./development/assets/js/lib/angular-sanitize.min.js',
'./development/assets/js/lib/toastr.min.js',
'./development/assets/js/lib/angular-datepicker.js',
'./development/assets/js/lib/angucomplete-alt.js',
'./development/assets/js/lib/d3.v3.min.js',
'./development/assets/js/lib/mm-foundation.min.js',
'./development/assets/js/lib/ng-text-truncate.js',
'./development/assets/js/lib/angular-lazy-loader.min.js',
'./development/assets/js/lib/jquery-jvectormap-2.0.3.min.js',
'./development/assets/js/lib/jquery-jvectormap-world-mill.js',
'./development/assets/js/lib/jquery.tagcanvas.min.js',
'./development/assets/js/lib/angular-touch.min.js',
'./development/assets/js/lib/slick.min.js',
'./development/assets/js/lib/angular-slick.min.js',
'./development/assets/js/lib/d3.tip.js',
'./development/assets/js/lib/angular-pageslide-directive.js',
'./development/assets/js/app.js',
'./development/assets/js/lib/upload.js',
'./development/assets/js/controllers/**/*.js',
'./development/assets/js/services/**/*.js',
'./development/assets/js/filters/**/*.js',
'./development/assets/js/directives/**/*.js'
])
.pipe(concat('production.js'))
.pipe(uglify())
.pipe(gulp.dest('./production/assets'))
})
Upon running the gulp scripts
command, I encounter an error. The following error stack trace is displayed:
events.js:85
throw er; // Unhandled 'error' event
^
Error
at new JS_Parse_Error (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1526:18)
at js_error (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1534:11)
at croak (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2025:9)
at token_error (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2033:9)
at unexpected (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2039:9)
at semicolon (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2059:43)
at simple_statement (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2239:73)
at eval (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2092:47)
at eval (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2072:24)
at block_ (eval at <anonymous> (/home/project/static/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2352:20)
I am seeking assistance in identifying the root cause of this issue. My Gulp version is 3.9.0, and the Node version is 0.12.7.