You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me help to minify the css and js files automatically and easily!
7
+
Let me help you minify css and js files automatically and easily!
8
8
9
-
This is only a shell script, depends on bash shell, gnu grep, wc, curl and nodejs/npm
9
+
This is only a shell script; it depends on bash shell, gnu grep, wc, curl and nodejs/npm.
10
10
11
-
it's based on [clean-css](github.com/jakubpawlowicz/clean-css), [uglify-js](github.com/mishoo/UglifyJS2) and [javascript-minifier.com](http://javascript-minifier.com)/[cssminifier.com](http://cssminifier.com)
11
+
It is based on [clean-css](github.com/jakubpawlowicz/clean-css), [uglify-js](github.com/mishoo/UglifyJS2) and [javascript-minifier.com](http://javascript-minifier.com)/[cssminifier.com](http://cssminifier.com).
12
12
13
-
you can contribute to the project you want!
13
+
Feel free to contribute to the project if you want!
14
14
15
-
Requirement
15
+
Requirements
16
16
========
17
-
- Bash shell(version > 4.0)
17
+
- Bash shell(version > 4.0)
18
18
- gnu grep
19
19
- wc (word count)
20
20
- Curl (version > 7.0)
21
-
-node.js >=(0.8.0)
21
+
-Node.js >=(0.8.0)
22
22
23
23
How to use?
24
24
========
@@ -30,16 +30,16 @@ $ git submodule update --init
30
30
$ npm install
31
31
```
32
32
33
-
You go to the target directory you want to minify, run the script(`path_of_script/minify.sh`), or pass the directory's path as a parameter to the script!
33
+
First go to the target directory you want to minify, then run the script(`path_of_script/minify.sh`). Or you can pass the directory's path as a parameter to the script!
34
34
35
-
You can even put the file or make link under `$HOME/bin`, then you can run this script everywhere easily!
35
+
You may even place the script file (or make a link to it) under the `$HOME/bin` directory, allowing you to conveniently run this script from any directory!
36
36
37
-
Explaination
37
+
Explanation
38
38
========
39
-
The script will scan all the directory under the current working directory, except path with '.git',
39
+
The script will scan all the directories under the current working directory, except path with '.git'.
40
40
41
-
and check all the js & css files if they already have a minified verion(currently, recognize by `.min` in filename, before file ext),
41
+
Then, it will check all the js & css files to see if they already have a minified version (currently, it recognizes it by looking for a `.min` in the filename, before the file extension).
42
42
43
-
if not, just minify it, otherwise, compare the last modify time between the origin and the minified version,
43
+
If the file does not have a minified version, it will minify it.
44
44
45
-
if the origin one is newer than the minified one, meens the minified file was older, then do the minify again!
45
+
Furthermore, even if there is a minified version available, the script will compare the last modified time between the original file and its minified version. If the original one is newer than the minified one -- which means the minified file is older than the original -- then it will replace the old minified file with a new minified version!
0 commit comments