vite-html
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

vite-html

html template for vite

NPM version NPM Downloads

English | 简体中文

Features

  • Support ejs template
  • Html entry alias
  • Inject js

Usage

import html from 'vite-html'
export default {
  plugins: [
    html(/* options */),
  ]
}

API

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
}

Package Sidebar

Install

npm i vite-html

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

6.04 kB

Total Files

5

Last publish

Collaborators

  • younglei