0.1.1 • Published 2 years ago

vite-html v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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
}