|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.isdc.wro.extensions.processor.support.uglify.UglifyJs
public class UglifyJs
The underlying implementation use untagged version (commited on 2012-09-08 14:15:12).
https://github.com/mishoo/UglifyJS
.
The uglify script is resulted from merging of the following two scripts: parse-js.js, process.js.
Nested Class Summary | |
---|---|
static class |
UglifyJs.Type
The type of processing supported by UglifyJs library. |
Field Summary | |
---|---|
static String |
DEFAULT_UGLIFY_JS
The name of the uglify script to be used by default. |
Constructor Summary | |
---|---|
UglifyJs(UglifyJs.Type uglifyType)
|
Method Summary | |
---|---|
static UglifyJs |
beautifyJs()
Factory method for creating the beautifyJs engine. |
protected String |
createOptionsAsJson()
Reads by default options from options.js file located in the same package. |
protected InputStream |
getScriptAsStream()
|
String |
process(String filename,
String code)
|
UglifyJs |
setReservedNames(String reservedNames)
some libraries rely on certain names to be used, so this option allow you to exclude such names from the mangler. |
static UglifyJs |
uglifyJs()
Factory method for creating the uglifyJs engine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_UGLIFY_JS
Constructor Detail |
---|
public UglifyJs(UglifyJs.Type uglifyType)
uglify
- if true the code will be uglified (compressed and minimized), otherwise it will be beautified (nice
formatted).Method Detail |
---|
public static UglifyJs uglifyJs()
public static UglifyJs beautifyJs()
public UglifyJs setReservedNames(String reservedNames)
reservedNames
- the reservedNames to setprotected InputStream getScriptAsStream()
public String process(String filename, String code) throws IOException
data
- js content to process.
IOException
protected String createOptionsAsJson() throws IOException
{ codegen_options: { beautify: false, space_colon: false }, squeeze: true, dead_code: true, mangle: true }
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |