UNPKG

@maizzle/framework

Version:

Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.

25 lines (24 loc) 829 B
import { defu as defu$1 } from "defu"; import { crush } from "html-crush"; //#region src/transformers/minify.ts const DEFAULT_OPTIONS = { removeLineBreaks: true }; /** * Minify an HTML string using `html-crush`. Maizzle's only default that * differs from html-crush's own defaults is `removeLineBreaks: true`. * * @param html HTML string to minify. * @param options [html-crush options](https://codsen.com/os/html-crush) merged * on top of the Maizzle defaults. * @returns The minified HTML string. * * @example * import { minify } from '@maizzle/framework' * * const tight = minify('<p> hello </p>', { removeIndentations: true }) */ function minify(html, options = {}) { return crush(html, defu$1(options, DEFAULT_OPTIONS)).result; } //#endregion export { minify }; //# sourceMappingURL=minify.js.map