vite-plugin-html-inject-commands
v0.0.1
Published
Inject commands result into index.html meta tag.
Downloads
6
Maintainers
Readme
vite-plugin-html-inject-commands
Inject commands result into index.html meta tag.
Install
# ✨ Auto-detect
npx nypm install -D vite-plugin-html-inject-commands
# npm
npm install -D vite-plugin-html-inject-commands
# yarn
yarn add -D vite-plugin-html-inject-commands
# pnpm
pnpm install -D vite-plugin-html-inject-commands
# bun
bun install -D vite-plugin-html-inject-commands
Usage
// vite.config.ts
import { defineConfig } from 'vite'
import HTMLInjectCommands from 'vite-plugin-html-inject-commands'
export default defineConfig({
plugins: [
HTMLInjectCommands({
commands: [
// eg: inject git commit hash and date to meta tag under head
{
name: 'git:commit',
command: 'git log -1 --format="hash=%h, date=%aI"',
errorMsg: 'Failed to get commit info',
},
],
}),
],
})
Contribution
- Clone this repository
- Install the latest LTS version of Node.js
- Enable Corepack using
corepack enable
- Install dependencies using
pnpm install
- Run tests using
pnpm dev
orpnpm test
License
Published under the MIT license. Made by @byronogis and community 💛
🤖 auto updated with automd