#!/bin/zsh

# Install (only run once)
if ! command -v html-minifier; then
    npm install html-minifier
fi

# Process all files
for filename in public/**/*.html; do
    echo $filename

    html-minifier \
        --collapse-whitespace \
        --remove-comments \
        --remove-optional-tags \
        --remove-redundant-attributes \
        --remove-script-type-attributes \
        --output "$filename" \
        "$filename"
done
