@e11ty/eleventy-plugin-html-terser
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@e11ty/eleventy-plugin-html-terser

An Eleventy plugin for post-processing generated sites through the powerful html-minifier-terser.

Why?

Because terser is dope and does dope shit.

Install

The module requires @11ty/eleventy be installed along side it.

pnpm add 11ty-html-terser @11ty/eleventy -D

The @11ty/eleventy module is a peer. You need to install it.

Usage

Pass it to the addPlugin within a .eleventy.js or .eleventy.cjs configuration file. Optionally use with 11ty.ts wrapper for type completions.

const { defineConfig } = require('11ty.ts'); // Optional
const { terser } = require('11ty-html-terser');

module.exports = defineConfig(eleventyConfig => {

  eleventyConfig.addPlugin(terser, {
    onlyProd: false, // Only Run when process.env.ENV === 'prod'
    terseOptions: {
      // Terser Options
    }
  })
})

See the available minification options for terserOptions.

License

Apache 2.0

Readme

Keywords

none

Package Sidebar

Install

npm i @e11ty/eleventy-plugin-html-terser

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

39.4 kB

Total Files

6

Last publish

Collaborators

  • sissel