If an Object is specified, it is passed directly to ast.mangle_properties() (mimicking command line behavior). Turn on or off property mangling with default options. Set this to true if you still care about full compliance with Internet Explorer 6-8 quirks. This string will be appended to the minified output. This string will be prepended to the minified output. RegExp '//' will preserve comments matching given RegExp or stringified RegExp.You will be passed the current node and the current comment and are expected to return either true or false 'some' will preserve all comments that include a closure compiler style directive ( Function specify your own comment preservation function.'all' will preserve all comments in code blocks that have not been squashed or dropped. output.ascii_onlyĮnables to encode non-ASCII characters as \uXXXX. The value of wrap is the global variable exports will be available as. Wrap all of the code in a closure, an easy way to make sure nothing is leaking.įor variables that need to be public exports and global variables are made available. This is useful if the source map location is not relative to the base path of the minified file, i.e. Override the calculated value for sourceMappingURL in the source map. If the sources are not absolute URLs after prepending of the sourceMap.root, the sources are resolved relative to the source map. With this option you can customize root URL that browser will use when looking for sources. Pass this flag if you want to include the content of source files in the source map as sourcesContent property. Uglify source is passed as the argument and the return value will be used as the sourceMap name. The location of an input source map from an earlier compilation, e.g. If a function is provided, the uglify destination is passed as the argument and the return value will be used as the file name. To customize the name or location of the generated source map, pass a string to indicate where to write the source map to. By default it will have the same basename as the dest file, but with a. If true, a source map file will be generated in the same directory as the dest file. This is useful to see exactly how well uglify-js is performing but using 'gzip' will make the task take 5-10x longer to complete. Report minification result or both minification and gzip results. Parse a single expression, rather than a program (for parsing JSON) report Turns on beautification of the generated source code. If an Object is specified, it is passed as options to UglifyJS.Compressor(). Turn on or off source compression with default options. If an Object is specified, it is passed directly to ast.mangle_names() and ast.compute_char_frequency() (mimicking command line behavior). Turn on or off mangling with default options. This task primarily delegates to UglifyJS, so please consider their documentation as required reading for advanced configuration. Task targets, files and options may be specified according to the grunt Configuring tasks guide. Run this task with the grunt uglify command. loadNpmTasks ( 'grunt-contrib-uglify' ) Uglify task
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |