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
kzc
b40d5de69c
Change the default sequences limit to 200 to speed up compress.
...
Has little or no impact on minification size in the majority of
cases but can speed up rollup builds significantly.
This sequences change also has the beneficial side effect of avoiding
"stack size exceeded" errors on very large input files.
The user is free to alter the sequences limit if they are so inclined.
The previous sequences limit was 2000. 20 is often sufficient.
2016-07-01 09:41:31 +02:00
kzc
b7ef7840f3
Allow sequences maximum length to be user configurable.
2016-07-01 09:41:31 +02:00
kzc
02c638209e
Enable --screw-ie8 by default.
...
catch identifier is mangled correctly for ES5 standards-compliant JS engines by default.
Unconditionally use the ie8 if/do-while workaround whether or not --screw-ie8 is enabled.
To support non-standard ie8 javascript use: uglifyjs --support-ie8
2016-06-30 21:49:48 +02:00
iliashk
030611b729
Add Node API documentation for mangling options
2016-06-30 21:45:25 +02:00
Asia
fc1abd1c11
Document the except option to mangle
...
Added documentation for the `except` option to the `mangle` option in the API reference.
2016-06-19 21:17:31 +02:00
Shrey Banga
e645ba84cf
Respect quote style in object literals
...
The option added in fbbaa42ee5 wasn't
being respected inside object literals, so quoted property names would
still be stripped out with this option.
This is mostly a corner-case, but useful when the output is passed to
something like the Closure compiler, where quoted property names can be
used to prevent mangling.
2016-06-19 21:13:31 +02:00
Anthony Van de Gejuchte
2149bfb707
Don't mix strings with directives in output
...
* Don't interpret strings with escaped content as directive
* Don't interpret strings after empty statement as directive
* Adapt output to prevent strings being represent as directive
* Introduce UGLIFY_DEBUG to allow internal testing like EXPECT_DIRECTIVE
2016-06-19 20:59:17 +02:00
Anthony Van de Gejuchte
d7971ba0e4
Fix test262 failures related to <, <=, in and instanceof
...
Fixed-by: @kzc
2016-06-15 23:11:08 +02:00
kzc
c55dd5ed74
Add passes compress option. Fix duplicate compress warnings.
2016-04-19 20:05:33 +02:00
Sebastien Daniel
9bcf702a6e
added documentation on conditional compilation using API
2016-03-27 19:42:52 +02:00
kzc
102d1b9137
#877 Ignore mangle sort option
2016-02-27 15:33:10 -05:00
Richard van Velzen
63b01fe8f9
Merge pull request #948 from kzc/collapse_vars_doc
...
collapse_vars: document the compress option in README
2016-02-11 22:13:30 +01:00
Martii
cdba43cfa4
Create and map bare-returns into new parse property name
2016-02-08 10:45:42 +01:00
kzc
12e6ad326c
collapse_vars: small change to README
2016-01-28 11:04:30 -05:00
kzc
00c8d1d241
collapse_vars: document option in README
2016-01-28 11:01:17 -05:00
Bryan Rayner
3eb9101918
Add mangleProperties documentation to README
...
Add additional documentation to mangleProperties.
2016-01-27 14:24:32 -06:00
Jeremy Marzka
799509e145
Added a mangle properties option
2016-01-26 22:10:08 +01:00
Samuel Reed
918c17bd88
Update README for /** @const */
2016-01-19 13:24:36 -06:00
ReadmeCritic
e87c77ed41
Update README URLs based on HTTP redirects
2015-11-27 08:46:55 -08:00
plievone
645626ebe8
Fix docs for keep_fargs
...
Compression options `keep_fargs` and `unsafe` were decoupled in v.2.5.0 (commit 5fd1245 ), so document actual keep_fargs default.
2015-11-14 11:38:00 +02:00
Damian Krzeminski
d5138f7467
add --pure-funcs option
...
it has the same effect as specifying `pure_funcs` in `--compressor`
option, however it's much easier to use
instead of:
--compressor 'pure_func=["Math.floor","debug","console.logTime"]'
it's now possible:
--compressor --pure-funcs Math.floor debug console.logTime
fixes #684
2015-10-13 21:24:14 -04:00
Richard van Velzen
d7a4a4a462
Merge pull request #729 from DrewML/keep_fnames_docs
...
Add keep_fnames compressor option to README.md
2015-08-07 14:11:50 +02:00
Joao Carlos
0b82e1cd5b
Change --mangle-regex to accept a full regex
2015-06-09 15:14:41 +03:00
Joao Carlos
0ac6918a41
Add --mangle-regex option
2015-06-09 14:16:50 +03:00
Andrew Levine
65ee5af78c
Add keep_fnames compressor option to README.md
2015-06-02 15:32:10 -05:00
David Caldwell
2850dc69fd
Document passing source maps directly to minify() using inSourceMap
2015-04-03 17:27:28 -07:00
Mihai Bazon
3ec11c781b
Update README
2015-03-29 13:13:40 +03:00
Mihai Bazon
ecfd881ac6
Keep unused function arguments by default
...
Discarding unused function arguments affects function.length, which can lead
to some hard to debug issues. This optimization is now done only in "unsafe
mode".
Fix #121
2015-03-20 10:28:51 +02:00
Mihai Bazon
fbbaa42ee5
Add option to preserve/enforce string quote style
...
`-q 0` (default) use single or double quotes such as to minimize the number of
bytes (prefers double quotes when both will do); this is the previous
behavior.
`-q 1` -- always use single quotes
`-q 2` -- always use double quotes
`-q 3` or just `-q` -- always use the original quotes.
Related codegen option: `quote_style`.
Close #495
Close #460
Some `yargs` guru please tell me why `uglifyjs --help` doesn't display the
help string for `-q` / `--quotes`, and why it doesn't output the expected
argument types anymore, like good old `optimist` did.
2015-01-27 22:26:27 +02:00
Richard van Velzen
285bffd2c6
Document -- for usage in CLI class
...
Close #518
2015-01-07 19:04:10 +01:00
Austin Brown
aa5dd15352
Update README.md
...
otions => options
2015-01-04 16:01:53 +01:00
Peter Dave Hello
5bff65c132
Use svg instead of png to get better image quality
2015-01-04 15:58:00 +01:00
Mihai Bazon
a64bdda9ae
Document keep_fargs. Close #557
2014-09-28 12:36:36 +03:00
Ingvar Stepanyan
e391367488
Added example for usage with SpiderMonkey AST.
2014-08-04 20:48:14 +03:00
Vladimir Agafonkin
9b404f9de6
fix readme typo (when -> with)
2014-02-06 18:11:33 +02:00
Mihai Bazon
1dd05f44eb
Merge branch 'sourcesContent' of https://github.com/arty-name/UglifyJS2 into arty-name-sourcesContent
2014-01-26 10:15:24 +02:00
Mihai Bazon
1ab2fdaa10
Fix example
2014-01-17 15:48:47 +02:00
Artemy Tregubenko
03cf94ebe8
Added support for sourcesContent property of source map
2014-01-09 15:12:00 +01:00
Mihai Bazon
dc5f70eab5
Add drop_console option to the compressor
2013-12-10 19:44:41 +02:00
Mihai Bazon
263577d5eb
[README] Fix #278
2013-10-30 14:13:30 +02:00
Mihai Bazon
f1b7094a57
Add "preamble" output option
...
Close #335
2013-10-29 11:09:18 +02:00
Mihai Bazon
f2348dd98b
Rename clean_getters to pure_getters; add pure_funcs.
2013-10-04 13:17:25 +03:00
Mihai Bazon
8cc86fee60
add clean_getters compressor option (default false)
...
allows one to specify if `foo.bar` is considered to have side effects.
2013-10-02 19:38:01 +03:00
Mihai Bazon
1a95007ec1
Remove --ie-proof from the readme.
...
Fix #276
2013-08-22 10:10:25 +03:00
Mihai Bazon
ed80b4a534
Move support for negate_iife in the compressor, rather than code generator
...
(the code generator doesn't maintain enough context to know whether
the return value is important or discarded)
Fixes #272
2013-08-20 17:45:52 +03:00
Mihai Bazon
6ea3f7fe34
fix usage
2013-08-08 09:15:13 +03:00
Mihai Bazon
4aa4b3e694
Support -p relative. Fix #256
2013-08-07 11:43:47 +03:00
Mihai Bazon
9fc6796d2a
Add negate_iife option to the code generator.
...
See discussion in a9511dfbe5
2013-05-22 21:22:14 +03:00
Nick Schonning
46814f88d9
Add Travis build badge to README
2013-05-08 23:48:12 -04:00
Kim Joar Bekkelund
790b3bcdc6
Fix typo in bin and readme
2013-05-02 11:15:33 +02:00
Uli Köhler
a54b6703c0
Add README syntax highlighting
2013-05-01 15:56:20 +02:00
Michael Ficarra
483e0cadfb
unbalanced parentheses in readme
2013-04-20 14:05:52 -05:00
Michał Gołębiowski
75f0bbe6e8
renamed --screw-ie to --screw-ie8, documented it in README.md, indicated it doesn't break IE9+
2013-03-25 17:03:21 +01:00
Mihai Bazon
9b1a40dfc3
Support mangling toplevel names
...
Close #127
2013-03-13 09:44:06 +02:00
Mihai Bazon
e4b078cff7
Disable unsafe by default
...
Close #147
2013-03-11 00:04:31 +02:00
Mihai Bazon
e9a571b2a1
Merge pull request #94 from paulmillr/patch-1
...
Add better fromstring docs.
2013-01-31 23:50:59 -08:00
Mihai Bazon
297af47c89
Add --source-map-url option
...
Fix #100
Fix #47
2013-01-20 12:32:07 +02:00
Forbes Lindesay
c13e7e621d
Update installation instructions re #4
2013-01-17 00:13:42 +00:00
Paul Miller
ad071f8017
Add better fromstring docs.
2013-01-13 18:45:43 +02:00
Jake Archibald
1d8871a092
Compressor options use underscores rather than hyphens
2013-01-08 12:33:58 -08:00
Mihai Bazon
130c623be7
Support output, mangle and compress options to UglifyJS.minify.
...
Close #57
Close #86
Close #33
2013-01-04 11:25:13 +02:00
Benoît Zugmeyer
e82e89d1b0
--version option
2013-01-03 11:07:53 +01:00
Mihai Bazon
83a4ebfedc
Implement -m sort=true
...
close #83
2013-01-02 12:39:00 +02:00
Mihai Bazon
642ba2e92c
rename the npm package to "uglify-js" and cli tool to "uglifyjs"
2012-11-21 13:27:03 +02:00
Sergej Tatarincev
11dffe950e
Add sourceRoot option to minify
2012-10-19 12:35:19 +03:00
Mihai Bazon
6f45928a73
add fromString argument to UglifyJS.minify (allows to pass the source
...
code, instead of file names, as first argument).
close #17
2012-10-18 15:49:15 +03:00
Mihai Bazon
4482fdd63f
added note about API docs and online demo
2012-10-17 21:59:36 +03:00
Mihai Bazon
6472f9410e
add semicolons option in the code generator (default: true)
...
pass `false` to separate statements with newlines instead of semicolons
2012-10-17 14:52:08 +03:00
Mihai Bazon
70d205c447
update for acorn
2012-10-13 00:35:24 +03:00
Mihai Bazon
4807c6e756
update on @cc_on
2012-10-09 19:09:11 +03:00
Mihai Bazon
dfc04e6677
add simple API wrapper: UglifyJS.minify
...
(refs #7 )
2012-10-08 21:15:59 +03:00
Mihai Bazon
42ea3c95e0
added some basic API doc
2012-10-08 14:30:34 +03:00
Mihai Bazon
dd8286bce1
added --self to easily get a browser-runnable version of UglifyJS
2012-10-08 12:55:18 +03:00
Mihai Bazon
fe1411bba1
fix typo
2012-10-05 23:10:52 +03:00
Mihai Bazon
42c25d901c
add note about installation
2012-10-05 15:31:55 +03:00
Mihai Bazon
e88dcc3819
added --acorn and --spidermonkey options
2012-10-05 15:22:12 +03:00
Mihai Bazon
7e8880be1c
document the CLI tool
2012-10-03 12:22:59 +03:00
Mihai Bazon
6569e66bf8
update with link to discussion about Esprima vs. UglifyJS speed
2012-08-29 11:18:05 +03:00
Mihai Bazon
ce8e8d57c0
added README
2012-08-27 12:29:53 +03:00