html template for vite
English | 简体中文
- Support ejs template
- Html entry alias
- Inject js
import html from 'vite-html'
export default {
plugins: [
html(/* options */),
]
}
export interface Options {
/** Value of script src */
inject?: string
/**
* Path of [name].html
*
* e.g.
* - 'public/index.html'
* - { 'index.html': 'public/index.ejs' }
*/
template?: string | { [entryAlias: string]: string }
data?: Record<string, any>
/** Finally value of `req.url` */
_url?: string
}