项目作者: jaredLunde

项目描述 :
Minify HTML in production using html-minifier with Snowpack
高级语言: TypeScript
项目地址: git://github.com/jaredLunde/snowpack-plugin-minify-html.git
创建时间: 2020-08-27T16:14:45Z
项目社区:https://github.com/jaredLunde/snowpack-plugin-minify-html

开源协议:MIT License

下载



snowpack-plugin-minify-html

Minify HTML in production using html-minifier with Snowpack

  1. 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

  1. // snowpack.config.js
  2. module.exports = {
  3. plugins: [
  4. [
  5. 'snowpack-plugin-minify-html',
  6. {
  7. /**
  8. * @see Plugin Options below
  9. */
  10. htmlMinifierOptions: {
  11. sortAttributes: true,
  12. removeComments: true,
  13. },
  14. },
  15. ],
  16. ],
  17. }

Plugin Options

  1. export interface SnowpackPluginHtmlMinifierOptions {
  2. /**
  3. * An array of glob patterns for files you want to explicitly include
  4. * for html-minifier minification. By default all HTML files are included.
  5. */
  6. include?: string[]
  7. /**
  8. * An array of glob patterns for files you want to exclude from
  9. * html-minifier minification
  10. */
  11. exclude?: string[]
  12. /**
  13. * html-minifier minify() options passed directly to html-minifier
  14. * @see https://github.com/kangax/html-minifier#options-quick-reference
  15. */
  16. htmlMinifierOptions?: htmlMinifier.Options
  17. }

LICENSE

MIT