1
- YUI Compressor - The Yahoo! JavaScript and CSS Compressor
1
+ Silverpeas's UI Compressor - The Silverpeas JavaScript and CSS Compressor
2
2
=========================================================
3
3
4
- The YUI Compressor is a JavaScript compressor which, in addition to removing
4
+ The Silverpeas's UI Compressor is a fork of YUI Compressor which is a JavaScript compressor which, in addition to removing
5
5
comments and white-spaces, obfuscates local variables using the smallest
6
6
possible variable name. This obfuscation is safe, even when using constructs
7
7
such as 'eval' or 'with' (although the compression is not optimal in those
8
- cases) Compared to jsmin, the average savings is around 20% .
8
+ cases).
9
9
10
- The YUI Compressor is also able to safely compress CSS files. The decision
10
+ It is also able to safely compress CSS files. The decision
11
11
on which compressor is being used is made on the file extension (js or css)
12
12
13
13
Building
14
14
--------
15
15
16
- ant
16
+ mvn clean install
17
17
18
18
Testing
19
19
-------
20
20
21
21
./tests/suite.sh
22
22
23
23
24
- Node.js Package
25
- ---------------
26
-
27
- You can require compressor in a Node.js package and compress files and strings in async.
28
- _ It still uses Java under the hood_
29
-
30
- npm i yuicompressor
31
-
32
- ``` javascript
33
-
34
- var compressor = require (' yuicompressor' );
35
-
36
- compressor .compress (' /path/to/file or String of JS' , {
37
- // Compressor Options:
38
- charset: ' utf8' ,
39
- type: ' js' ,
40
- nomunge: true ,
41
- ' line-break' : 80
42
- }, function (err , data , extra ) {
43
- // err If compressor encounters an error, it's stderr will be here
44
- // data The compressed string, you write it out where you want it
45
- // extra The stderr (warnings are printed here in case you want to echo them
46
- });
47
-
48
- ```
49
-
50
- Options:
51
- * ` charset ` // defaults to 'utf8'
52
- * ` type ` // defaults to 'js'
53
- * ` line-break `
54
- * ` nomunge `
55
- * ` preserve-semi `
56
- * ` disable-optimizations `
57
-
58
-
59
- TODO
60
- ----
61
-
62
- * Better Docs
63
- * Help Pages
64
-
65
- Build Status
66
- ------------
67
-
68
- [ ![ Build Status] ( https://secure.travis-ci.org/yui/yuicompressor.svg?branch=master )] ( http://travis-ci.org/yui/yuicompressor )
69
-
70
-
71
24
Global Options
72
25
--------------
73
26
74
27
-h, --help
75
- Prints help on how to use the YUI Compressor
28
+ Prints help on how to use the Silverpeas's UI Compressor
76
29
77
30
--line-break
78
31
Some source control tools don't like files containing lines longer than,
@@ -89,18 +42,18 @@ Global Options
89
42
required if the input file extension is neither 'js' nor 'css'.
90
43
91
44
--charset character-set
92
- If a supported character set is specified, the YUI Compressor will use it
45
+ If a supported character set is specified, the Silverpeas's UI Compressor will use it
93
46
to read the input file. Otherwise, it will assume that the platform's
94
47
default character set is being used. The output file is encoded using
95
48
the same character set.
96
49
97
50
-o outfile
98
51
99
- Place output in file outfile. If not specified, the YUI Compressor will
52
+ Place output in file outfile. If not specified, the Silverpeas's UI Compressor will
100
53
default to the standard output, which you can redirect to a file.
101
54
Supports a filter syntax for expressing the output pattern when there are
102
55
multiple input files. ex:
103
- java -jar yuicompressor .jar -o '.css$:-min.css' *.css
56
+ java -jar silverpeas-ui-compressor .jar -o '.css$:-min.css' *.css
104
57
... will minify all .css files and save them as -min.css
105
58
106
59
-v, --verbose
@@ -114,8 +67,7 @@ JavaScript Only Options
114
67
115
68
--preserve-semi
116
69
Preserve unnecessary semicolons (such as right before a '}') This option
117
- is useful when compressed code has to be run through JSLint (which is the
118
- case of YUI for example)
70
+ is useful when compressed code has to be run through JSLint
119
71
120
72
--disable-optimizations
121
73
Disable all the built-in micro optimizations.
127
79
128
80
* Supports wildcards for specifying multiple input files.
129
81
130
- * The YUI Compressor requires Java version >= 1.5 .
82
+ * The Silverpeas's UI Compressor requires Java version >= 1.8 .
131
83
132
84
* It is possible to prevent a local variable, nested function or function
133
85
argument from being obfuscated by using "hints". A hint is a string that
@@ -152,7 +104,7 @@ The hint itself disappears from the compressed file.
152
104
153
105
* C-style comments starting with ` /*! ` are preserved. This is useful with
154
106
comments containing copyright/license information. As of 2.4.8, the '!'
155
- is no longer dropped by YUICompressor . For example:
107
+ is no longer dropped by Silverpeas's UI Compressor . For example:
156
108
157
109
```
158
110
/*!
@@ -162,12 +114,12 @@ The hint itself disappears from the compressed file.
162
114
*/
163
115
```
164
116
165
- remains in the output, untouched by YUICompressor .
117
+ remains in the output, untouched by Silverpeas's UI Compressor .
166
118
167
119
Modified Rhino Files
168
120
--------------------
169
121
170
- YUI Compressor uses a modified version of the Rhino library
122
+ Silverpeas's UI Compressor uses a modified version of the Rhino library
171
123
(http://www.mozilla.org/rhino/ ) The changes were made to support
172
124
JScript conditional comments, preserved comments, unescaped slash
173
125
characters in regular expressions, and to allow for the optimization
0 commit comments