![]() You can pass a comma-separated list of compress options. You need to pass -compress ( -c) to enable the compressor. Or -source-map "content=inline" if the source map is included inline with To use this feature pass -source-map "content='/path/to/input/source.map'" Assuming you have a mapping fromĬoffeeScript → compiled JS, UglifyJS can generate a map from CoffeeScript →Ĭompressed JS by mapping every token in the compiled JS to its original Like to map back to the original code (i.e. When you're compressing JS code that was output by a compiler such asĬoffeeScript, mapping to the JS code won't be too helpful. The sourceĪs the source map root, and the original files as js/file1.js and The above will compress and mangle file1.js and file2.js, will drop the Otherwise UglifyJS assumes HTTP X-SourceMap is being used and will omit the source-map "url=''" to specify the URL where the source map can be found. source-map "names=false" to omit symbol names if you want to reduce size source-map "root=''" to pass the URL where the original files can be found. ![]() The value ofįilename is only used to set file attribute (see the spec) source-map "filename=''" to specify the name of the source map. source-map -output output.js (source map will be written out to UglifyJS can generate a source map file, which is highly useful forĭebugging your compressed JavaScript. Specify -output ( -o) to declare the output file. Specify the name that your module will take Need to pass an argument to this option to “exports” and “global” variables available. wrap Embed everything in a big function, making the webkit Support non-standard Safari/Webkit.Įquivalent to setting `webkit: true` in `minify()`īy default UglifyJS will not try to be Safari-proof. v8 Support non-standard Chrome & Node.jsĮquivalent to setting `v8: true` in `minify()`īy default UglifyJS will not try to be v8-proof. toplevel Compress and/or mangle variables in top level scope. timings Display operations run time on STDERR. `url` If specified, path to the source map to append in `root` Path to the original source to be included in `names` Include symbol names in the source map. `includeSources` Pass this flag if you want to include `filename` Filename and/or location of the output source JS that was generated from some other originalĬode. `content` Input source map, useful if you're compressing `base` Path to compute relative paths from input files. source-map Enable source map/specify source map options: self Build UglifyJS as a library (implies -wrap UglifyJS) name-cache File to hold mangled name mappings. module Process input as ES module (implies -toplevel) keep-fnames Do not mangle/drop function names. keep-fargs Do not mangle/drop function arguments. ie Support non-standard Internet Explorer.Įquivalent to setting `ie: true` in `minify()`įor `compress`, `mangle` and `output` options.īy default UglifyJS will not try to be IE-proof. expression Parse a single expression, rather than a program ![]() e, -enclose ] Embed everything in a big function, with configurable config-file Read `minify()` options from JSON file. Kept when compression is on, because of deadĬode removal or cascading statements into Note that currently not *all* comments can be a valid JS RegExp like `/foo/` or `/^!/` to JSDoc-style comments that contain You can optionally pass one of the Byĭefault this works like Google Closure, keeping comments Preserve copyright comments in the output. no-annotations Ignore and discard comment annotations. annotations Process and preserve comment or `/*#_PURE_*/`) `spidermonkey` to write UglifyJS or SpiderMonkey AST o, -output Output file path (default STDOUT). O, -output-opts Specify output options (`beautify` disabled by default). `preamble` Preamble to prepend to the output. `beautify` Enabled with `-beautify` by default. b, -beautify Beautify output/specify output options: `regex` Only mangle matched property names. `keep_quoted` Only mangle unquoted properties. `domprops` Mangle property names that overlaps `builtins` Mangle property names that overlaps mangle-props Mangle properties/specify mangler options: `reserved` List of names that should not be mangled. m, -mangle Mangle names/specify mangler options: `pure_funcs` List of functions that can be safely c, -compress Enable compressor/specify compressor options: `spidermonkey` Assume input files are SpiderMonkey `bare_returns` Allow return outside of functions. `-help options` for details on available options.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |