Skip to content

Instantly share code, notes, and snippets.

@borestad
Created October 25, 2017 08:51
Show Gist options
  • Save borestad/6d66644a163b5610944e44f64ab86973 to your computer and use it in GitHub Desktop.
Save borestad/6d66644a163b5610944e44f64ab86973 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
GITROOT=$(git rev-parse --show-toplevel)
ROOT=$GITROOT/packages/www
INPUT=$ROOT/public
OUTPUT=$ROOT/public
minifier=$ROOT/node_modules/.bin/html-minifier
# See: html-minifier --help
$minifier \
--input-dir $INPUT \
--output-dir $OUTPUT \
--file-ext html \
--process-conditional-comments \
--html5 \
--trim-custom-fragments \
--collapse-inline-tag-whitespace \
--preserve-line-breaks \
--use-short-doctype \
--remove-script-type-attributes \
--remove-style-link-type-attributes \
--minify-css 1 \
--minify-js 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment