0.3.0 • Published 3 years ago
minify-html-ssr v0.3.0
minify-html-ssr
For SSR WASM import.
What it does
This library removes extraneous whitespaces between HTML tags. Single spaces are preserved where necessary.
Directions
Local
- wasm-pack build --target=nodejs --out-dir path-to-node-project
- import and add
const { minify_html } = require('../utils/minify-html/html_whitespace');
to your render pipeline.
res.send(minify_html(body));
npm package
npm install minify-html-ssr
- Minify the html body before sent down.
Downsides
This is a runtime library. It is meant to work fast for you. However, a build time solution that collapses whitespace might be better for your app.