Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

v1.3.0

v1.3.0
- support for directives (i.e. "use strict";)
- newlines in multi-line comments trigger ASI
- added nodeunit dependency for NPM, other code restructuring
- apply ascii_only option to regexps
- allow defines when not mangling
- some parser/code generator fixes #376, #396
- (static) mangler optimization for gzip (#397)

Contributors (in no particular order):

Richard van Velzen <rvanvelzen@expert-shops.com>
Paul Baumgart <paul@proxv.com>
Mal Graty <mal.graty@googlemail.com>
Jez Ng <jezreel@gmail.com>
Robert Gust-Bardon <donate@robert.gust-bardon.org>

v1.2.1

don't walk label statements twice (closes #272)

v1.2

updated doc
added --no-mangle-functions

v1.1.1

add final semicolon (closes #126)

v1.0.4

fixed mangling of lambda names (regressed as of ae88177)
fixes #165

v1.0.3

mangled name of a function expression should not clash with a name in…
… the

parent scope, in order to deal with a 15 years-old IE bug. (fixes #161)

thanks everyone for the discussion and patience!

v1.0.2

simple "make" utility. ideas welcome.
For now, write a Makefile.uglify.js file with contents like this:

    {
      files: [
        { name: "foo.js", module: "Foo" },
        { name: "bar.js", hide: true }
      ]
    }

If you run uglifyjs --make it will read and compress foo.js and wrap it like
this:

    (function(){ return this })().Foo = (function(exports, global){
        ... compressed contents of foo.js ...
    })({}, (function(){ return this })());

as for bar.js it'll wrap like this:

    (function(){
        ... compressed contents of bar.js ...
    })()

Both of them are concatenated and returned.

The "module" is thus useful to use libraries designed for a CommonJS
environment in browser.

This is just a quick hack as I needed it fast, but the plan is to evolve
it—handle compressor options in the Makefile, additional possibilities to
wrap the files, maybe handle require(...).

v1.0

transform a["123"] into a[123] (fixes #107)

v0.90

keep the first token in ast_walker, ast_add_scope and ast_mangle (use…
…ful for

the case where we include the original token in the AST, see parse())

v0.1

fixed doc rendering for github
Something went wrong with that request. Please try again.