Minify all the files under a directory.
$ npm install -g minify-dir
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.
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
Include minify-dir
package in your code.
const minifyDir = require('minify-dir');
Minify all files under website
directory recursively,
defualt will output to website.min
directory.
minifyDir.minifyDirectory([source], [option destination]);
/* Default Output => `website.min` */
minifyDir.minifyDirectory("./website");
/* Target Output => `website2` */
minifyDir.minifyDirectory("./website", "./website2");
Minify a CSS/HTML/JS file, default will output
to website.min/anyfile.html
.
minifyDir.minifyFile([source], [option destination]);
/* Default Output => `website.min/anyfile.html` */
minifyDir.minifyFile("./website/anyfile.html");
/* Target Output => `website2/anyfile.html` */
minifyDir.minifyFile("./website/anyfile.html", "./website2/anyfile.html");
- HTML Minifider - http://minifycode.com/
- CSS Minifier - https://www.minifier.org/
- JS Minifier - https://www.minifier.org/