FAQ Database Discussion Community


Uglify with sourceMap option enabled don't match the filerev js file it should reference

gruntjs,yeoman,grunt-contrib-uglify
Hello, I just enable sourceMap option of the grunt-contrib-uglify module to generate a map file for my concat-jshint-minified-filerev javascript files. In the dist directory I can see : dist/ vendor.6ff9fbf4.js vendor.6ff9fbf4.js.map But if I edit vendor.6ff9fbf4.js, I can see at the end of file that the referenced sourceMap is...

Grunt Uglify produces code that browsers do not agree with

javascript,grunt-contrib-uglify
I am new to Grunt and to grunt-contrib-uglify. I have created a test JavaScript file: function global(window) { window.test = alert("Test"); test(); })(window); When this is uglified, it appears as !function(a){a.test=alert("Test"),test()}(window); jsfiddle I am confused by two things: Why is there a comma rather than a semi-colon between ("Test") and...

Grunt hangs on uglify

node.js,gruntjs,minify,grunt-contrib-uglify
I am trying to minify a little angular script, but for some reason uglify just hangs indefinitely. JSHint runs fine and completes if I add it into the task list, and then it hangs on uglify. Here is my Gruntfile: module.exports = function (grunt) { // Project configuration grunt.initConfig({ //...

Complex gruntjs tasks

gruntjs,grunt-contrib-concat,grunt-contrib-uglify
I have the following scenario: concat some files uglify some files (based on the concatinated ones) concat a files to another file (that was uglified above) How would I write gruntfile.js? I tried something as this but it didn't work. Thanks module.exports = function(grunt) { grunt.initConfig({ pkg:grunt.file.readJSON('package.json'), concat: { target:...

Uglify can't parse “flow.js”

bower,grunt-usemin,grunt-contrib-uglify,angular-fullstack,ng-flow
I'm having an annoying issue where uglify (called through grunt-usemin) cannot parse the url for a package named flow.js. This package is installed as a dependency of ng-flow. The url looks like this: bower_components/flow.js/dist/flow.js When I run grunt build, I get the following error: Warning: Unable to read "dist/public/bower_components/flow.js" file...

message: 'Unexpected token: punc (.)', while using uglify in grunt

javascript,css,gruntjs,grunt-contrib-uglify
Goal My goal is to concatenate all my css,js files and minify all of them. I can minify my concat.js, but I'm struggling trying to minify my concat.css. Gruntfile.js module.exports = function(grunt) { "use strict"; grunt.initConfig({ concat: { js: { src: [ 'js/bootstrap.min.js', 'js/jquery-1.10.2.min.js', 'js/jquery.easypiechart.min.js', 'js/jquery.isotope.min.js', 'js/jquery.magnific-popup.min.js', 'js/waypoints.min.js', 'js/respond.min.js', 'js/jquery.vegas.min.js',...