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

0.0.3 • Public • Published

vite-plugin-html-banner

This is an extension plugin for the vite.

Adds a banner to the generated html.

Installation

$ npm install -d vite-plugin-html-banner
$ yarn add -D vite-plugin-html-banner

Basic Usage

Load the plugin.

const htmlBanner = require('vite-plugin-html-banner')

And add it to your vite.config.js config as follows:

import { defineConfig } from 'vite'
import htmlBanner from 'vite-plugin-html-banner'

export default defineConfig({
  plugins: [htmlBanner('hello world')],
})

You will get the following results:

<!--hello world-->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title></title>
  </head>
  <body></body>
</html>

Options

htmlBanner(options)

options: string | string[] | { content: string | string[] }

Enter a string or array as follows:

htmlBanner('hello world')
// If you enter an array, it will be automatically converted to a string separated by '\n'.
htmlBanner(['hello world'])

Or enter a object as follows:

(features will be added in the future)

htmlBanner({ content: 'hello world' })
htmlBanner({ content: ['hello world'] })

License

MIT

Package Sidebar

Install

npm i vite-plugin-html-banner

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

5.6 kB

Total Files

7

Last publish

Collaborators

  • ljw1412