-d SYMBOL or -define SYMBOL - will replaceĪll instances of the specified symbol where used as an identifier. ![]() -v or -verbose - output some notes on STDERR (for now just how long.Useful for debugging or learning more about the -ast - pass this if you want to get the Abstract Syntax Tree instead.Pass -overwrite then the output will be written in the same file. -overwrite - if the code is read from a file (not from STDIN) and you.This isn’t given, the result goes to standard output (or see next one). -o filename or -output filename - put the result in filename.-nc or -no-copyright - by default, uglifyjs will keep the initialĬomment tokens in the generated code (assumed to be copyright informationĮtc.).This option to disable this optimization. Obviously unreachable (code that follows a return, throw, break orĬontinue statement and is not a function/variable declaration). -no-dead-code - by default, UglifyJS will remove code that is.Libs that I tested it on, but pass -no-seqs to disable it. This is ONīy default because it seems safe and saves a few hundred bytes on some In various occasions, this allows us to discard theīlock brackets (since the block becomes a single statement). For example, “a = 10 b = 20 foo() ” will be written as no-squeeze) it will reduce consecutive statements in blocks into a -no-seqs - when ast_squeeze() is called (thus, unless you pass.-mt or -mangle-toplevel - mangle names in the toplevel scope too.Optimizations that result in smaller, less readable code). -ns or -no-squeeze - don’t call ast_squeeze() (which does various.-nmf or -no-mangle-functions – in case you want to mangle variable.-nm or -no-mangle - don’t mangle names.(the output is always encoded in UTF8,īut if you pass this option you’ll only get ASCII). By default UglifyJS won’t bother to do it and will -ascii - pass this argument to encode non-ASCII characters as.Known as aliasing in the Closure Compiler. -c or -consolidate-primitive-values - consolidates null, Boolean,Īnd String values.Only keys that cannot be identifier names will be quotes). -q or -quote-keys - quote keys in literal objects (by default,.-i N or -indent N - indentation level (number of spaces).-b or -beautify - output indented code when passed, additional.If you don’t specify it, it will read code Calls involving the global Array constructorįilename should be the last argument and should name the file from which The following transformations can in theory break code, although they’re That when certain symbols are replaced by constant values, entire codeīlocks may be optimised away as unreachable. Make UglifyJS operate slightly more like a compilation process, in When combined with the optimisations above this can the pre-processor ofĬ/C++) to allow you to safely replace selected global symbols with act a limited version of a pre-processor (c.f.Return, throw, break or continue statement, except remove some unreachable code and warn about it (code that follows a.Our mangler willĪnalyze the code and generate proper variable names, depending on scopeĪnd usage, and is smart enough to deal with globals defined elsewhere, or ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |