https://github.com/vite-plugin/vite-html
html template for vite
https://github.com/vite-plugin/vite-html
Last synced: 4 months ago
JSON representation
html template for vite
- Host: GitHub
- URL: https://github.com/vite-plugin/vite-html
- Owner: vite-plugin
- License: mit
- Created: 2022-05-20T07:42:31.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-01T13:26:34.000Z (almost 4 years ago)
- Last Synced: 2025-03-22T08:03:30.088Z (about 1 year ago)
- Language: TypeScript
- Size: 17.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-html
html template for vite
[](https://npmjs.org/package/vite-html)
[](https://npmjs.org/package/vite-html)
English | [简体中文](https://github.com/vite-plugin/vite-html/blob/main/README.zh-CN.md)
## Features
- Support [ejs](https://github.com/mde/ejs) template
- Html entry alias
- Inject js
## Usage
```js
import html from 'vite-html'
export default {
plugins: [
html(/* options */),
]
}
```
## API
```ts
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
/** Finally value of `req.url` */
_url?: string
}
```