0.2.0 • Published 2 years ago

@sardine/eleventy-plugin-tinyhtml v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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