Questions tagged [grunt-contrib-uglify]

Minify files with UglifyJS.

Grunt task to minify files with UglifyJS.

244 questions
36
votes
9 answers

how to minify js files in order via grunt-contrib-uglify?

I have a directory like below: /folder/b.js /folder/jQuery.js /folder/a.js /folder/sub/c.js I want to minify all these js files in one js file in order: jQuery.js -> a.js -> b.js -> c.js Q: 1.How can I do it via grunt-contrib-uglify?(In fact, there…
just4fun
  • 537
  • 1
  • 6
  • 13
34
votes
2 answers

Grunt concat + uglify with sourcemaps

I use concat to merge JS files into one file and uglify to minimize the JavaScript. How can I create a sourcemaps file that uses the source JS files? My current gruntfile: concat: { options: { // define a string to put between each file…
26
votes
2 answers

Does grunt-contrib-uglify not parse "let" keywords?

I am getting an error, 'Unexpected token: name (bazz)' when my grunt task is running uglify. The only thing I noticed on that line was that I was using the 'let' keyword instead of 'var', so I wasn't sure why that error was getting thrown. I…
Michael M
  • 466
  • 2
  • 7
  • 14
24
votes
2 answers

Gruntfile.js - Task "default" not found

Here is my Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), uglify: { options: { mangle: true } build: { src:…
Kevin Lewis
  • 1,070
  • 3
  • 10
  • 18
22
votes
5 answers

some es6 features are not understood by grunt uglify js?

I used grunt-uglify in my project and I'm working with es6. for some es6 features, such as fat arrow function, it's throwing an error. I think the uglify don't understant that syntax. so do i have a way to fix this issue. I mean can i use anything…
user6536526
22
votes
5 answers

Change link or script filename in html after gruntjs minify/uglify

I am using standard minify/uglify for css/js files and combine multiple files to main.min.css or app.min.js... However my .html file needs to be modified to point to these new file names too in or