Search Posts

Category: grunt-contrib-uglify

grunt usemin – concat + uglify sourcemap

I’m trying to minify my js and css files but i have problems with source map files. My app is an angularjs app and before the usemin i need to generate the angular templates.js files and concatenate all js files. my index.html is <!– build:js js/vendor.min.js –> <script src=”../vendor/jquery/dist/jquery.min.js”></script> <script src=”../vendor/underscore/underscore-min.js”></script> <script src=”../vendor/bootstrap/dist/js/bootstrap.min.js”></script> <script src=”../vendor/es5-shim/es5-shim.min.js”></script> <script src=”../vendor/json3/lib/json3.min.js”></script> <script src=”../vendor/http/http.min.js”></script> <script src=”../vendor/fs/dist/fs.min.js”></script> <script src=”../vendor/parse/parse.min.js”></script> <script src=”../vendor/event/dist/js/event.min.js”></script> <script src=”../vendor/angular/angular.min.js”></script> <!– endbuild –> <!– build:js js/app.min.js –> <script […]

JS_Parse_Error : ‘Unexpected token name «key», expected punc «;»’

I have an Angular JS 1.5 application building in Jenkins job. After adding some new code, Job is unable to create Script.js (minified version) with the following error:- [4mRunning “uglify:generated” (uglify) task[24m JS_Parse_Error { message: ‘Unexpected token name «key», expected punc «;»’, filename: ‘../../.tmp/concat/scripts/scripts.js’, line: 58567, col: 12, pos: 2182150, stack: ‘Errorn at new JS_Parse_Error (/home/jenkins/workspace/ABC/ABC-Builder/node_modules/uglify-js/lib/parse.js:196:18)n I have tried the following to identify the actual issue: Code changes since last successful build. All the js […]

Grunt uglify using babel not working es6

For the past day I have been struggling with minifying my angularJs file. The file is in es6 format. The angularJs file var myApp = angular.module(‘myApp’, [‘ui.router’, ‘testData’]); angular.element(document).ready(() => { = xxx(‘path’);{ onLoad: ‘login-required’ }) .success((authenticated) => { //code }) .error(function() { window.location.reload(); }); }); myApp.config(function($stateProvider, $urlRouterProvider, $httpProvider) { $httpProvider.interceptors.push(‘authInterceptor’); //ui router code }); myApp.factory(‘authInterceptor’, function($q, Auth) { return { request: function (config) { //code return deferred.promise; } }; }); The package.json […]