-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Readme.md mangle
settings
#2286
Conversation
These are based off https://github.com/Perlmint/UglifyJS2/blob/0976fc3e4b303be6de8a366f8406d8906b5521e1/lib/minify.js#L54-L61 And had no documentation update from this issue #1753 and this PR #1851. Discovered when working on this Pull Request devpunks/snuggsi#78 Please let me know where i can better update copy text. Difficult to know what the flags do without a readme for the flags. ;-) Thanks! /cc @brandondees @robcole @angelocordon
@@ -64,6 +64,13 @@ a double dash to prevent input files being used as option arguments: | |||
not used. | |||
-m, --mangle [options] Mangle names/specify mangler options: | |||
`reserved` List of names that should not be mangled. | |||
`cache` Boolean for cache determination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove cache
option. See --name-cache
flag instead.
@@ -64,6 +64,13 @@ a double dash to prevent input files being used as option arguments: | |||
not used. | |||
-m, --mangle [options] Mangle names/specify mangler options: | |||
`reserved` List of names that should not be mangled. | |||
`cache` Boolean for cache determination. | |||
`eval` Boolean for mangling `eval` statements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is incorrect. See existing description.
`ie8` Mangle support for ie8. | ||
`keep_fnames` Keep function names. | ||
`properties` Mangle properties. | ||
`safari10` Boolean flag used to bypass Safari 10 `let` bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option only exists on the harmony
branch for uglify-es
.
`keep_fnames` Keep function names. | ||
`properties` Mangle properties. | ||
`safari10` Boolean flag used to bypass Safari 10 `let` bug. | ||
`toplevel` Boolean flag to determine toplevel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect description. Please use existing.
|
||
- `ie8` (default `false`). Mangle support for ie8. | ||
|
||
- `properties` (default `false`). Mangle properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a sub-option object with options of its own. See mangle properties.
@@ -745,9 +752,16 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u | |||
Useful for code relying on `Function.prototype.name`. See also: the `keep_fnames` | |||
[compress option](#compress-options). | |||
|
|||
- `eval` (default `false`). Pass `true` to mangle names visible in scopes | |||
where `eval` or `with` are used. | |||
- `cache` (default `false`). Boolean for cache determination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kzc please provide the copy you would like to see and I will update. Again it was like a cat and mouse game chasing docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the cache
option altogether. It is accessed via the flag:
--name-cache <file> File to hold mangled name mappings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake - this is the API section. cache
is a cache object.
Also out of curiosity should this be on the harmony branch? |
`eval` Boolean for mangling `eval` statements. | ||
`ie8` Mangle support for ie8. | ||
`keep_fnames` Keep function names. | ||
`properties` Mangle properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties
is not accessible from the CLI. Use --mangle-props
instead.
The options pertaining to |
|
||
- `properties` (default `false`). Mangle properties. | ||
|
||
- `safari10` (default `false`). Boolean flag used to bypass Safari 10 `let` bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already documented in the harmony
branch for uglify-es
.
https://github.com/mishoo/UglifyJS2/tree/harmony#mangle-options |
I think the CLI mangle options should just link to the above link rather than repeat all the mangle sub-options. |
@kzc to be clear in what you are saying you are telling me to link to the mangle options in the |
ES5 There's no need to redundantly enumerate all the sub-options in the CLI sections. Just make a PR on
|
Oh i see @kzc I shall address the others. I'm fairly new at uglifyjs but pretty good at creating technical documentation I know you mentioned it before but can you provide some laundry list of what i should look at? I thought was a quick fix for |
Also @kara @alexlamsl wanted to say I owe ya some coffee at least for making such an awesome project. We went through EVERYTHING in the past 6 months. UglifyES is helping us deliver a 1kB package to the browser Even fits within an ethernet frame. :-) I thought Uglify would do transpilation for us but we decided to go with buble. Anticipating build pipelines to decrease by about 80% over the coming years. But see UglifyJS definitely within the remaining 20% (as far as we're concerned). Again thanks so much for the contributions! 🙏 /cc @brandondees |
@snuggs Thanks for the kind words.
If you think you can make the documentation more coherent, go for it. Off the top of my head:
|
Closing as this is superseded by recent updates to |
Care to drop a sha @alexlamsl? Thanks for the movement on this... I recently have been dealing with health issues from both my mothers. I'll get in where I fit in on the next go round! 🙏 💛 |
These are based off https://github.com/Perlmint/UglifyJS2/blob/0976fc3e4b303be6de8a366f8406d8906b5521e1/lib/minify.js#L54-L61
And had no documentation update from this issue #1753 and this PR #1851.
Discovered when working on this Pull Request devpunks/snuggsi#78
Please let me know where i can better update copy text. Difficult to know what the flags do without a readme for the flags. ;-)
Thanks!
/cc @brandondees @robcole @angelocordon