rollup-plugin-minifyliterals

1.1.0 • Public • Published

rollup-plugin-minifyliterals

Minify html in template literals using html-minifier.

Experimental support for minifying templates literals that have already been transpiled (i.e. string concatenation).

Installation

npm install --save-dev rollup-plugin-minifyliterals

Usage

For best results run before transpiling to es5. This will allow you to send extra options to through to html-minifier.

// rollup.config.js
import minifyliterals from 'rollup-plugin-minifyliterals'
import buble from 'buble'
 
export default {
  entry: 'src/index.js',
  dest: 'dist/my-lib.js',
  plugins: [
    minifyliterals({
      // set this to `false` if you're not using sourcemaps –
      // defaults to `true`
      sourceMap: true,
      // optionally pass through options to html-minifier -
      // defaults to `{ collapseWhitespace: true }`
      htmlminifier: {
        removeRedundantAttributes: true
      },
      // optionally process transpiled template literals -
      // defaults to false (experimental, not widely tested)
      literals: true
    }),
    buble()
  ]
}
 

License

MIT

Package Sidebar

Install

npm i rollup-plugin-minifyliterals

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

16.2 kB

Total Files

5

Last publish

Collaborators

  • tmpst