rollup-plugin-generate-html
v0.2.0
Published
Generate html file for your Rollup bundle
Downloads
184
Maintainers
Readme
rollup-plugin-generate-html
Generate html file for your Rollup bundle.
Installation
# yarn
yarn add rollup-plugin-generate-html -D
# npm
npm install rollup-plugin-generate-html -D
Usage
// rollup.config.js
import generateHtml from 'rollup-plugin-generate-html'
export default {
input: 'src/index.js',
output: {
file: 'dist/app.js',
format: 'iife'
},
plugins: [
generateHtml({
filename: 'dist/public/index.html'
})
]
}
Configuration
There are some useful options:
filename
Type: string
Path for generated html file.
generateHtml({
filename: 'dist/public/index.html'
})
template
Type: string
| Default: included template string
Path for template to use.
generateHtml({
filename: 'dist/public/index.html',
template: 'src/assets/template.html'
})
selector
Type: string
| Default: body
Selector where to place scripts.
generateHtml({
filename: 'dist/public/index.html',
selector: 'head'
})
inline
Type: boolean
| Default: false
Inline scripts in template.
generateHtml({
filename: 'dist/public/index.html',
inline: true
})
formatInline
Type: boolean
| Default: false
Beautify inline scripts.
generateHtml({
filename: 'dist/public/index.html',
inline: true,
formatInline: true
})
License
MIT