North Pittsburgh Meatpackers

    snowpack-plugin-minify-html
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    snowpack-plugin-minify-html

    Minify HTML in production using html-minifier with Snowpack

    npm i snowpack-plugin-minify-html

    Types Build status NPM Version MIT License


    When to use this

    You should only use this if you aren't already using a bundler (Webpack, Parcel, Rollup) to build your production site.

    Quick start

    // snowpack.config.js
    module.exports = {
      plugins: [
        [
          'snowpack-plugin-minify-html',
          {
            /**
             * @see Plugin Options below
             */
            htmlMinifierOptions: {
              sortAttributes: true,
              removeComments: true,
            },
          },
        ],
      ],
    }

    Plugin Options

    export interface SnowpackPluginHtmlMinifierOptions {
      /**
       * An array of glob patterns for files you want to explicitly include
       * for html-minifier minification. By default all HTML files are included.
       */
      include?: string[]
      /**
       * An array of glob patterns for files you want to exclude from
       * html-minifier minification
       */
      exclude?: string[]
      /**
       * html-minifier minify() options passed directly to html-minifier
       * @see https://github.com/kangax/html-minifier#options-quick-reference
       */
      htmlMinifierOptions?: htmlMinifier.Options
    }

    LICENSE

    MIT

    Install

    npm i snowpack-plugin-minify-html

    DownloadsWeekly Downloads

    11

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    20.1 kB

    Total Files

    12

    Last publish

    Collaborators

    • jaredlunde