@sardine/eleventy-plugin-tinyhtml
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

eleventy-plugin-tinyHTML

An 11ty plugin to optimise HTML.

Features

Requirements

Installation

npm install --save-dev @sardine/eleventy-plugin-tinyhtml

How to use it

const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml');
module.exports = function (eleventyConfig) {
  eleventyConfig.addPlugin(tinyHTML);
};

Configuration

const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml');
module.exports = function (eleventyConfig) {
  const tinyHTMLOptions = {
    html5: true,
    removeRedundantAttributes : true,
  };

  eleventyConfig.addPlugin(tinyHTML, tinyHTMLOptions);
};

html-minifier options

By default the following options are used:

{
  collapseBooleanAttributes: true,
  collapseWhitespace: true,
  decodeEntities: true,
  html5: true,
  removeAttributeQuotes: true,
  removeComments: true,
  removeOptionalTags: true,
  sortAttributes: true,
  sortClassName: true,
};

License

MIT

Package Sidebar

Install

npm i @sardine/eleventy-plugin-tinyhtml

Weekly Downloads

75

Version

0.2.0

License

MIT

Unpacked Size

8.8 kB

Total Files

8

Last publish

Collaborators

  • petinga
  • marabyte