Questions tagged [uglifyjs]

Uglifyjs is a general-purpose JavaScript parser/compressor/beautifier toolkit. It is developed on NodeJS, but it should work on any JavaScript platform supporting the CommonJS module system.

Useful links

847 questions
0
votes
1 answer

Angular not found when I try to uglify the files

I used grunt and usemin to concatenate and uglify the following:
Shamoon
  • 41,293
  • 91
  • 306
  • 570
0
votes
1 answer

How can sourcemaps be merged

I'm using Grunt to build a project: uglify for authored JS files and then concat with libs that are already minified. The minified libs already have sourcemaps. Is it possible to merge them with the ones generated by uglify for the authored JS…
Francisc
  • 77,430
  • 63
  • 180
  • 276
0
votes
1 answer

StaticFileHandler doesn't serve my file

I serve with the StaticFileHandler a file that come from uglifyjs. If the file is single line, and the output uglifyjs is not terminated by an end of line character, it doesn't work: >xxd static/index.js ... 0000010: .... .... .... 3b If I open it…
julienfr112
  • 2,077
  • 2
  • 25
  • 37
0
votes
1 answer

uglifyjs throws out punc() with a colon

Warning: Uglification failed. Unexpected token: punc ()). grunt build gives this issue, which calls the uglify task, does it have to do with the ':' that I've misused?
user2167582
  • 5,986
  • 13
  • 64
  • 121
0
votes
2 answers

Turn on symfony2 assetic only in dev env

Can I use assetic if I can't install anything on prod env? Is it possible to use assetic with uglifyjs and uglifycss only on dev env and use "uglified" files in prod env?
tommy
  • 388
  • 2
  • 14
0
votes
1 answer

Grunt Uglify; script merging produces error

When 'grunt build' is run all the scripts are merged and minified. This produces a 'undefined' error because one of the scripts is missing a ; semicolon to properly end the script. Basically we need such a option:…
sunpatel
  • 15
  • 1
  • 6
0
votes
1 answer

Install node uglifyjs on Windows from local folder

I'm trying to install uglifyjs on my computer from local folders. I downloaded all dependencies of uglifyjs, including dependencies of dependencies, and they are all available in my folder C:\npm\node_modules I'm working on Windows XP, and when I'm…
alexmngn
  • 9,107
  • 19
  • 70
  • 130
0
votes
1 answer

UglifyJS 2: api equivalent for cli -m toplevel?

I'm trying to convert the following command: uglifyjs src1.js src2.js -c -m toplevel --screw-ie8 to an API call: ug.minify(['src1.js','src2.js'], {mangle:true, compress:true, ie_proof:false}) But I can't figure out how to set 'toplevel'. Setting…
pixelmike
  • 1,973
  • 1
  • 19
  • 31
0
votes
2 answers

Grails uglifyjs plugin does not work

I have added uglifyjs plugin to my project with grails install-plugin uglify-js-minified-resources. Also added compile ":uglify-js-minified-resources:0.1.1" to my BuildConfig.groovy file. After starting application none of the js files was…
kuldarim
  • 1,096
  • 8
  • 21
  • 44
0
votes
2 answers

Grunt: "Uglification failed"

I'm trying to use a gruntfile to uglify my JS and CSS. The one problem is that uglify doesn't work, the terminal gives a very vague error... Gruntfile.js module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg:…
Valerie
  • 34
  • 2
  • 6
0
votes
1 answer

Preserve directory structures when optimizing js files with grunt + uglify

I'm using the grunt Uglify plugin to minify the JS files. The issue I'm having, is that I would like to keep the src directory structure in the dest directory as well. example: **src dir:** js |- app1 |- randomFile.js |- scripts |-…
Maurice
  • 1,223
  • 14
  • 21
0
votes
1 answer

Unable to link sourceMap in UglifyJS2

I am using following command in nodeJS script to generate sourceMap: var uglifyRes = uglify.minify(jsFiles, { outSourceMap: path + ".js.map" }); fs.writeFileSync('foo.js', uglifyRes.code); fs.writeFileSync('foo.js.map', uglifyRes.map); This…
Abhijeet Pawar
  • 690
  • 6
  • 19
0
votes
2 answers

Combine r.js and UglifyJS parameters

I'm optimizing my requirejs project with r.js. In my JS code, I need to replace an alias with the version number. It works fine when my build.js file contains the following: ({ appDir: "../", baseUrl: "scripts", mainConfigFile:…
Haji
  • 1,715
  • 7
  • 25
  • 41
0
votes
1 answer

UglifyJS to transform javascript code

I am trying to use UglifyJS for the first time. Iwould like to tranform the below code using UglifyJS function someFn(){ var someVar="test"; if(browser=="IE7"){ .... console.log("something"); …
zigzag.bond
  • 308
  • 3
  • 15
0
votes
1 answer

uglifyjs on client-side javascript ? (or an alternative parser)

I need to parse (and possibly modify) a js expression from within javascript (Specifically i want to markup some eval() expressions before the actual eval) I really like the UglifyJS README examples, but alas, it needs node.js Is there any way to…
Y A
  • 33
  • 4