Jiavan
b39043f3ab
re-introduce enclose ( #3163 )
...
fixes #2443
2018-06-01 16:47:11 +08:00
exvisory
0b7c70f726
Update README.md to clarify --source-map filename option ( #3137 )
...
Clarify that the --source-map filename option does NOT change the source map output filename but does set the 'file' attribute within the output source map. This was already documented in the API section of the README so I just copied that to the CLI options section, and a fragment to the CLI summary.
2018-05-18 15:50:36 +08:00
Alex Lam S.L
c71ed91e63
update AST documentation ( #3094 )
...
fixes #2622
2018-04-24 14:39:12 +08:00
Alex Lam S.L
183da16896
handle pure_funcs under inline & reduce_vars correctly ( #3066 )
...
fixes #3065
2018-04-10 02:46:38 +08:00
Alex Lam S.L
b29d435bb5
refactor brackets to braces ( #3005 )
2018-03-15 15:46:45 +08:00
Alex Lam S.L
d8fc281915
update dependencies ( #3002 )
...
acorn 5.5.3
commander 2.15.0
Miscellaneous
- drop unmaintained package from README
2018-03-14 15:54:41 +08:00
Alex Lam S.L
fc6ebd04a5
preserve case when inline_script ( #2991 )
...
fixes #2989
2018-03-11 05:11:12 +08:00
Alex Lam S.L
a75a046abb
compress arguments[index] ( #2967 )
...
- always replace with existing parameter
- only introduce new parameter if `keep_fargs` is disabled
2018-03-02 11:22:09 +08:00
Alex Lam S.L
0daa199fa8
migrate safe transformations out of unsafe_comps ( #2962 )
...
fixes #2959
2018-02-28 22:02:24 +08:00
Dan
cb0257dbbf
describe a few compiler assumptions ( #2883 )
2018-02-06 14:19:03 +08:00
Alex Lam S.L
069df27bf1
enable unsafe for test/ufuzz.js ( #2819 )
...
- introduce `unsafe_undefined`
- safer `.toString()` compression
Miscellaneous
- rename `unsafe_Function`
2018-01-19 23:47:42 +08:00
Joël Galeran
424173d311
fix typo in README ( #2792 )
2018-01-16 10:29:38 +08:00
Alex Lam S.L
7d3cddf9d6
inline functions with AST_Var ( #2688 )
2018-01-03 01:54:44 +08:00
Alex Lam S.L
86ae5881b7
disable hoist_funs by default ( #2626 )
2017-12-20 17:05:40 +08:00
Alex Lam S.L
ef618332ea
fold cascade functionality into collapse_vars ( #2586 )
2017-12-14 01:20:36 +08:00
Alex Lam S.L
97c464dbf5
fix wording and formatting ( #2512 )
2017-11-25 19:07:46 +08:00
Alex Lam S.L
b80062c490
enable hoist_props by default ( #2492 )
2017-11-19 14:56:23 +08:00
kzc
6142117cdd
document the webkit output option ( #2490 )
...
- workaround for WebKit bugs
- PhantomJS users should enable this output option
closes #2489
2017-11-17 13:46:49 +08:00
kzc
557636f3b7
update documentation for reduce_funcs ( #2478 )
2017-11-14 16:03:25 +08:00
Alex Lam S.L
3c74047368
implement compress option reduce_funcs ( #2466 )
...
- inline single-use function declarations as expressions when permissible
- depend on `reduce_vars`
- enabled by default
- disable for speed critical code
fixes #2464
2017-11-11 05:59:35 +08:00
kzc
ae67a49850
document compress option hoist_props ( #2399 )
2017-10-25 14:03:43 +08:00
Tom MacWright
1968203d83
docs: Fix spelling and style ( #2395 )
2017-10-24 04:59:12 +08:00
Alex Lam S.L
9f4b98f8e4
backport #2374 ( #2376 )
2017-10-19 23:02:27 +08:00
Alex Lam S.L
ec598c351b
fix-ups for #2356 ( #2360 )
2017-10-15 22:33:55 +08:00
Roger Peppe
99800d4aa9
update README to include defaults ( #2356 )
...
fixes #2353
2017-10-12 02:56:02 +08:00
Tim Malone
70d56c951a
Update README.md - sourceMappingURL directive note ( #2355 )
...
Moves this README note to underneath the 'url' rather than 'root' option.
2017-10-11 19:48:43 +08:00
David Šanda
71d52f147d
Fix CLI example for mangle reserved list of names ( #2294 )
2017-08-31 00:55:32 +08:00
David Šanda
eb7adaa6fc
Fix CLI source-maps examples ( #2291 )
...
fixes #2284
2017-08-29 23:49:20 +08:00
Alex Lam S.L
458e3e15f0
enhance passes ( #2229 )
...
- remove hardcoded upper limit
- continue based on node count reduction
- emit verbose statistics
fixes #2226
2017-07-13 02:18:59 +08:00
kzc
145874e504
docs: update benchmarks using node 8, add babili ( #2218 )
2017-07-09 01:06:15 +08:00
Alex Lam S.L
1ac25fc032
improve compress granularity through typeofs ( #2201 )
...
fixes #2198
2017-07-05 19:20:33 +08:00
kzc
f3a487a368
document fast mangle-only minify mode ( #2194 )
2017-07-03 01:37:04 +08:00
Alex Lam S.L
bdeadffbf5
improve usability of name cache under minify() ( #2176 )
...
fixes #2174
2017-06-29 12:48:34 +08:00
kzc
da2de350c3
add comment about quote_style and gzip ( #2092 )
2017-06-14 12:23:03 +08:00
Alex Lam S.L
3493a182b2
implement function inlining ( #2053 )
...
- empty body
- single `AST_Return`
- single `AST_SimpleStatement`
- avoid `/*#__PURE__*/`
Miscellaneous
- enhance single-use function substitution
fixes #281
2017-06-06 05:49:53 +08:00
kzc
f330ab743a
better document behavior of unsafe_Func ( #2043 )
2017-06-02 12:07:17 +08:00
kzc
f71e8fd948
reformat mangle options section of README ( #2036 )
2017-05-31 21:52:43 +08:00
Alex Lam S.L
e9645e017f
introduce unsafe_Func ( #2033 )
...
Separate flag for #203 functionality.
2017-05-31 03:38:00 +08:00
Alex Lam S.L
e62b879b48
display default values in --help options ( #2018 )
2017-05-28 22:57:20 +08:00
kzc
1ff8e9dd38
clarify what --mangle-props does ( #2012 )
2017-05-27 13:17:30 +08:00
kzc
78309a293d
better document mangle properties options ( #2009 )
2017-05-27 02:28:43 +08:00
kzc
695e182d59
fix and expand --mangle-props documentation ( #2008 )
...
fixes #2007
2017-05-27 01:25:51 +08:00
Alex Lam S.L
793d61499b
report timing breakdown ( #2000 )
...
fix corner cases with `sourceMap`
fixes #1998
2017-05-25 07:15:55 +08:00
kzc
69ac794bc8
add another minify() options example ( #1988 )
2017-05-22 12:19:07 +08:00
Alex Lam S.L
efdb65913b
improve usability of global_defs in minify() ( #1987 )
...
Use `@key` to `parse()` string value as `AST_Node`.
fixes #1986
2017-05-22 01:38:43 +08:00
kzc
a1dedeb3ce
more refinement of minify() documentation ( #1983 )
2017-05-21 04:55:03 +08:00
kzc
22aedef849
document minify() option toplevel ( #1979 )
2017-05-20 22:09:21 +08:00
kzc
5bf8d7e949
document 3.x minify() does not throw errors ( #1975 )
2017-05-20 10:49:35 +08:00
kzc
1df9d06f4a
document minify warnings and add an error example ( #1973 )
2017-05-19 17:20:21 +08:00
Alex Lam S.L
eae26756f1
introduce unsafe_regexp ( #1970 )
...
fixes #1964
2017-05-19 09:06:29 +08:00
Kara
6ed90913ca
fix docs for side_effects flag to reflect current behavior ( #1966 )
2017-05-18 10:51:49 +08:00
Rob Garrison
baef8bf050
update output options in readme ( #1958 )
2017-05-17 11:54:46 +08:00
alexlamsl
0813c5316f
remove Travis CI badge
2017-05-17 10:32:59 +08:00
Alex Lam S.L
cb45886512
export TreeTransformer ( #1950 )
...
- link to existing documentation on `TreeWalker` & `TreeTransformer`
- fix Travis build failures
fixes #1949
2017-05-16 19:59:05 +08:00
alexlamsl
f18abd1b9c
minor fixes to README.md
2017-05-16 01:33:01 +08:00
kzc
3be06ad085
reorg README for 3.x ( #1942 )
2017-05-16 01:12:00 +08:00
kzc
504a436e9d
Tweak README Notes ( #1934 )
2017-05-14 02:12:14 +08:00
olsonpm
fd0951231c
document 3 max passes ( #1928 )
2017-05-13 12:54:32 +08:00
olsonpm
9e29b6dad2
clarify wording ( #1931 )
2017-05-13 12:54:01 +08:00
olsonpm
547f41beba
add documentation for side_effects & [#@]__PURE__ ( #1925 )
2017-05-12 12:29:55 +08:00
kzc
2b44f4ae30
update README ( #1918 )
2017-05-12 03:36:33 +08:00
Alexis Tyler
e51c3541da
fix typo ( #1913 )
2017-05-11 20:24:33 +08:00
Alex Lam S.L
3bf194684b
update documentation ( #1909 )
...
- clarify options on `--source-map`
- fix `minify()` examples
fixes #1905
2017-05-11 17:50:50 +08:00
kzc
04f2344efc
Remove unnecessary git clone instructions in README ( #1897 )
2017-05-10 11:06:50 +08:00
kzc
bad9d5cf88
Change harmony to uglify-es in master README ( #1895 )
2017-05-10 05:07:45 +08:00
Alex Lam S.L
bc3fa78e8c
mention minify().error
2017-05-09 16:09:48 +08:00
kzc
3dd328dce3
[3.x] fix documentation for beautify options ( #1882 )
...
- use underscores rather than dashes.
2017-05-08 23:06:56 +08:00
Alex Lam S.L
da295de82b
support dumping AST ( #1879 )
...
Re-order `AST_Binary` properties to make dump more readable.
closes #769
2017-05-08 06:23:01 +08:00
Alex Lam S.L
2d99d06601
update documentation
...
Remove deprecated CLI option
2017-05-07 03:02:46 +08:00
kzc
64d74432f6
update README for 3.x ( #1840 )
2017-04-23 04:28:32 +08:00
Roman Dvornov
6f954aa3d0
Fix API reference examples ( #1834 )
2017-04-21 02:23:41 +08:00
Alex Lam S.L
251ff1d1af
update README ( #1813 )
...
- mention major version bump
- remove reference to internal API
2017-04-16 04:04:28 +08:00
Alex Lam S.L
ec443e422c
unify CLI & API under minify() ( #1811 )
...
- rename `screw_ie8` to `ie8`
- rename `mangle.except` to `mangle.reserved`
- rename `mangle.properties.ignore_quoted` to `mangle.properties.keep_quoted`
- compact `sourceMap` options
- more stringent verification on input `options`
- toplevel shorthands
- `ie8`
- `keep_fnames`
- `toplevel`
- `warnings`
- support arrays and unquoted string values on CLI
- drop `fromString` from `minify()`
- `minify()` no longer handles any `fs` operations
- unify order of operations for `mangle_properties()` on CLI & API
- `bin/uglifyjs` used to `mangle_properties()` before even `Compressor`
- `minify()` used to `mangle_properties()` after `Compressor` but before `mangle_names()`
- both will now do `Compressor`, `mangle_names()` then `mangle_properties()`
- `options.parse` / `--parse` for parser options beyond `bare_returns`
- add `mangle.properties.builtins` to disable built-in reserved list
- disable with `--mangle-props builtins` on CLI
- `warnings` now off by default
- add `--warn` and `--verbose` on CLI
- drop `--enclose`
- drop `--export-all`
- drop `--reserved-file`
- use `--mangle reserved` instead
- drop `--reserve-domprops`
- enabled by default, disable with `--mangle-props domprops`
- drop `--prefix`
- use `--source-map base` instead
- drop `--lint`
- remove `bin/extract-props.js`
- limit exposure of internal APIs
- update documentations
closes #96
closes #102
closes #136
closes #166
closes #243
closes #254
closes #261
closes #311
closes #700
closes #748
closes #912
closes #1072
closes #1366
fixes #101
fixes #123
fixes #124
fixes #263
fixes #379
fixes #419
fixes #423
fixes #461
fixes #465
fixes #576
fixes #737
fixes #772
fixes #958
fixes #1036
fixes #1142
fixes #1175
fixes #1220
fixes #1223
fixes #1280
fixes #1359
fixes #1368
2017-04-15 23:50:50 +08:00
Alex Lam S.L
0f4cd73dcc
introduce "strict" to pure_getters ( #1795 )
2017-04-07 13:31:58 +08:00
Alex Lam S.L
257ddc3bdb
improve compression of undefined, NaN & Infinitiy ( #1748 )
...
- migrate transformation logic from `OutputStream` to `Compressor`
- always turn `undefined` into `void 0` (unless `unsafe`)
- always keep `NaN` except when avoiding local variable redefinition
- introduce `keep_infinity` to suppress `1/0` transform, except when avoiding local variable redefinition
supersedes #1723
fixes #1730
2017-04-01 03:02:14 +08:00
Alex Lam S.L
ee95c1b38b
metadata cleanup ( #1630 )
...
- mention performance anomaly in Node 7 and drop from CI
- remove unused npm "scripts"
- mark browserify dependency as optional
- stop `test/mozilla-ast.js` from spamming console output in later versions of Node.js
2017-03-23 01:31:46 +08:00
Christian Maughan Tegnér
b7c112eefe
Add --in-source-map inline documentation ( #1611 )
2017-03-17 03:08:38 +08:00
Alex Lam S.L
711f88dcb4
scan assignment value in drop_unused() ( #1578 )
...
those were not optimised for `unused` before, which made it necessary for `reduce_vars` to have separate steps for `keep_fnames`
docs update by @kzc
closes #1577
2017-03-08 18:37:32 +08:00
Alex Lam S.L
1f0333e9f1
stay safe with constants in IE8- ( #1547 )
...
- `undefined` etc. can be redefined at top-level for IE8-, so disable related optimisations
- fixed `--support-ie8` catch mangle bug
2017-03-05 12:51:11 +08:00
Alex Lam S.L
07accd2fbb
process code with implicit return statement ( #1522 )
...
Bookmarklet for instance implicitedly assumes a "completion value" without using `return`.
The `expression` option now supports such use cases.
Optimisations on IIFEs also enhanced.
fixes #354
fixes #543
fixes #625
fixes #628
fixes #640
closes #1293
2017-03-03 18:13:07 +08:00
Alex Lam S.L
18059cc94f
compress numerical expressions ( #1513 )
...
safe operations
- `a === b` => `a == b`
- `a + -b` => `a - b`
- `-a + b` => `b - a`
- `a+ +b` => `+b+a`
associative operations
(bit-wise operations are safe, otherwise `unsafe_math`)
- `a + (b + c)` => `(a + b) + c`
- `(n + 2) + 3` => `5 + n`
- `(2 * n) * 3` => `6 * n`
- `(a | 1) | (2 | d)` => `(3 | a) | b`
fixes #412
2017-03-03 18:04:32 +08:00
Alex Lam S.L
f5cbe19b75
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
2017-03-01 04:12:10 +08:00
kzc
b1c593a041
add harmony branch details in README ( #1507 )
2017-02-27 01:55:24 +08:00
Alex Lam S.L
834f9f3924
update docs for pure_funcs & drop_console ( #1503 )
...
closes #1362
closes #1399
2017-02-25 04:13:10 +08:00
alexlamsl
4e49302916
enable collapse_vars & reduce_vars by default
...
- fix corner cases in `const` optimisation
- deprecate `/*@const*/`
fixes #1497
closes #1498
2017-02-24 01:46:57 +08:00
alexlamsl
ec64acd2c8
introduce unsafe_proto
...
- `Array.prototype.slice` => `[].slice`
closes #1491
2017-02-21 13:29:58 +08:00
alexlamsl
e275148998
enhance global_defs
...
- support arrays, objects & AST_Node
- support `"a.b":1` on both cli & API
- emit warning if variable is modified
- override top-level variables
fixes #1416
closes #1198
closes #1469
2017-02-21 13:29:58 +08:00
alexlamsl
148047fbbf
drop unused: toplevel, assign-only
...
- assign statement does not count towards variable usage by default
- only works with assignments on the same scope level as declaration
- can be disabled with `unused` set to "keep_assign"
- `toplevel` to drop unused top-level variables and/or functions
- `top_retain` to whitelist top-level exceptions
closes #1450
2017-02-21 13:29:57 +08:00
kzc
ec2e5fa3a2
Have minify() and tests use figure_out_scope() as uglifyjs CLI does
...
Clarify docs, help and tests for --support-ie8 and screw_ie8=false
2017-01-19 17:14:33 +01:00
Wiktor Kwapisiewicz
0913db8c84
Add note about name mangling when using --mangle-props=unquoted ( #1314 )
2017-01-19 16:47:10 +01:00
1111hui
a7b3b0d3a5
docs: add doc for option.outFileName
2016-11-29 20:29:12 +01:00
Ashley (Scirra)
2a9989dd18
Add --mangle-props-debug and fix --mangle-props=unquoted collision
...
Patch by @AshleyScirra
Based on: PR #1316
Renamed the CLI debug option to --mangle-props-debug
Fixes : #1321 name collision in --mangle-props=unquoted
2016-11-29 20:25:39 +01:00
Anthony Van de Gejuchte
8d74f34373
Don't filter shebangs when using the 'some' comment filter
...
Also clarify documentation a bit more about using regexp as filter
2016-10-23 21:31:03 +02:00
pengzhenqing
e51c6ba380
Add an option for writing inline source map
2016-10-23 21:21:39 +02:00
alexlamsl
4761d07e0b
Optimize unmodified variables
2016-10-01 11:36:11 +02:00
Anthony Van de Gejuchte
0111497fc9
Make all comment options in cli available in js api
...
Also removing more code within "loop" while at it.
2016-09-06 17:54:45 +02:00
Timothy Gu
37f4395cc0
Add missing { in README
...
Also fix a trivial style mistake.
2016-08-14 21:52:39 +02:00
homuler
9edbe93df5
Fix the document of keep_fnames option
2016-07-17 19:50:48 +02:00
Yotam Spenser
af37ecafe1
Source map URL override from programmatic API
2016-07-17 19:39:08 +02:00
kzc
5576e2737a
Document that the smallest sequences optimization length is 2
...
and a sequences value of 1 is considered to be `true` - which
will be set to the default value of 200.
2016-07-01 09:41:31 +02:00