minify-dir
Minify all the files under a directory.
Install
$ npm install -g minify-dir
Usage
usage : minify-dir I_FOLDER [output O_FOLDER] Minify-Dir : Minify all the files under a directory. positional arguments: I_FOLDER Directory you want to minified. optional arguments: O_FOLDER Output all the minified files here.
CLI
Try minify a directory
.
# Default Output => `website.min` $ minify-dir ./website # Target Output => `website2` $ minify-dir ./website ./website2
Or you can minify file
instead of a directory
.
# Default Output => `website.min/anyfile.html` $ minify-dir ./website/anyfile.html # Target Output => `website2/anyfile.html` $ minify-dir ./website/anyfile.html ./website2/anyfile.html
Example Code
Include minify-dir
package in your code.
const minifyDir = ;
Minify all files under website
directory recursively,
defualt will output to website.min
directory.
minifyDir; /* Default Output => `website.min` */minifyDir; /* Target Output => `website2` */minifyDir;
Minify a CSS/HTML/JS file, default will output
to website.min/anyfile.html
.
minifyDir; /* Default Output => `website.min/anyfile.html` */minifyDir; /* Target Output => `website2/anyfile.html` */minifyDir;
Service Provider
- HTML Minifider - http://minifycode.com/
- CSS Minifier - https://www.minifier.org/
- JS Minifier - https://www.minifier.org/