HTML import plugin for rollup
npm install @movable/rollup-plugin-htmlRollup plugin for loading content of HTML files to use as string variable in JavaScript code.
``bash`
npm install --save-dev rollup-plugin-html
`js
import { rollup } from 'rollup';
import html from 'rollup-plugin-html';
rollup({
entry: 'main.js',
plugins: [
html({
include: '*/.html'
})
]
}).then(...)
`
Type: array or string */.html
Default:
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 undefined
Default:
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.:
`JavaScript``
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.