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