diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-01 04:12:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-01 04:12:10 +0800 |
commit | f5cbe19b753bf84f8b11f96e2c91a8ca49525dba (patch) | |
tree | 75569231e92b9d72baab77ed81961b415e13e1e7 /README.md | |
parent | b34fa11a13221b7ad26ea48f18fcf2f5903c94c1 (diff) | |
download | tracifyjs-f5cbe19b753bf84f8b11f96e2c91a8ca49525dba.tar.gz tracifyjs-f5cbe19b753bf84f8b11f96e2c91a8ca49525dba.zip |
invert `reduce_vars` tracking flag (#1519)
Modules like webpack and grunt-contrib-uglify still uses `ast.transform(compressor)` before `Compressor.compress(ast)` was introduced.
Workaround this compatibility issue by deactivating `reduce_vars` in such case.
Also fix use case with omitted `options` when calling `Compressor()`.
fixes #1516
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -621,7 +621,7 @@ function uglify(ast, options, mangle) { // Compression uAST.figure_out_scope(); - uAST = uAST.transform(UglifyJS.Compressor(options)); + uAST = UglifyJS.Compressor(options).compress(uAST); // Mangling (optional) if (mangle) { @@ -865,7 +865,7 @@ toplevel.figure_out_scope() Like this: ```javascript var compressor = UglifyJS.Compressor(options); -var compressed_ast = toplevel.transform(compressor); +var compressed_ast = compressor.compress(toplevel); ``` The `options` can be missing. Available options are discussed above in |