@movable/rollup-plugin-html

0.3.0 • Public • Published

rollup-plugin-html Build Status

Rollup plugin for loading content of HTML files to use as string variable in JavaScript code.

Installation

npm install --save-dev rollup-plugin-html

Usage

import { rollup } from 'rollup';
import html from 'rollup-plugin-html';

rollup({
	entry: 'main.js',
	plugins: [
		html({
			include: '**/*.html'
		})
	]
}).then(...)

Options

include

Type: array or string
Default: **/*.html

A single file pattern, or an array of file patterns to include when importing html files. For more details see rollup-pluginutils.

exclude

Type: array or string
Default: undefined

A single file pattern, or an array of file patterns to exclude when importing html files. For more details see rollup-pluginutils.

htmlMinifierOptions

Type: Object Default: {}

The options which are given to html-minifier

E.g.:

rollup({
	entry: 'main.js',
	plugins: [
		html({
			include: '**/*.html',
			htmlMinifierOptions: {
				collapseWhitespace: true,
				collapseBooleanAttributes: true,
				conservativeCollapse: true,
				minifyJS: true
			}
		})
	]
}).then(...)

License

MIT

Credits

Thanks for Bogdan Chadkin (@TrySound) for his rollup-plugin-string rollup plugin which I used as the basis for this plugin.

Package Sidebar

Install

npm i @movable/rollup-plugin-html

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

4.94 kB

Total Files

5

Last publish

Collaborators

  • chayelheinsen
  • polera-mi
  • movable-ink
  • mnutt
  • shyshy
  • nicksteffens_mi
  • mansurtsutiev
  • mi_rtepper
  • aqmnguyen