一覧へ戻る
bdadam/rollup-plugin-html(新しいタブで開きます)
主要言語: JavaScript
Import HTML files as strings in rollup build
- star 数
- 38
- watcher 数
- 2
- fork 数
- 10
- issue 数
- 4
- 最終更新
- 2018/12/10
主要言語: JavaScript
Import HTML files as strings in rollup build
Rollup plugin for loading content of HTML files to use as string variable in JavaScript code.
npm install --save-dev rollup-plugin-html
import { rollup } from 'rollup'; import html from 'rollup-plugin-html'; rollup({ entry: 'main.js', plugins: [ html({ include: '**/*.html' }) ] }).then(...)
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.
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.
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(...)
MIT
Thanks for Bogdan Chadkin (@TrySound) for his rollup-plugin-string rollup plugin which I used as the basis for this plugin.