This wercker step minifies static resources like HTML, CSS and JS files.
This step is designed to be used with a static site generator like Jekyll or hugo. You can configure it to fit your needs.
All parameters are optional. Don't put them in your wercker.yml to use the default values.
basedir
: The directory containing the website to be minified. Default ispublic
.threads
: The number of simultaneous operations. Put this between quotes (e.g. "4"). Default is the number of cores of the host.htmlargs
: The arguments for html-minifier. Default is--use-short-doctype --remove-style-link-type-attributes --remove-script-type-attributes --remove-comments --minify-css --minify-js --collapse-whitespace --remove-comments-from-cdata --conservative-collapse --remove-cdatasections-from-cdata
.yuiargs
: The arguments for yuicompressor. No arguments by default.html
: Set this tofalse
to disable HTML minification. Default istrue
.css
: Set this tofalse
to disable CSS minification (CSS in HTML files will still be minified if you don't changehtml
orhtmlargs
). Default istrue
js
: Set this tofalse
to disable JS minification (JS in HTML files will still be minified if you don't changehtml
orhtmlargs
). Default istrue
htmlext
: The extension of the HTML files to be minified. Default ishtml
.cssext
: The extension of the CSS files to be minified. Default iscss
.jsext
: The extension of the JS files to be minified. Default isjs
.
box: debian
build:
steps:
- samueldebruyn/minify:
basedir: _site
threads: "3"
box: wercker/default
build:
steps:
- samueldebruyn/minify:
basedir: _site
threads: "3"
This script uses html-minifier to minify HTML files and yuicompressor to minify CSS and JS files. This also means that the script installs node, curl and java if they aren't already installed.
The script should work on any OS using apt-get or yum as package managers.
This wercker step is licensed under the MIT License. Create a pull request or an issue to contribute.