0.0.1 • Published 1 year ago

vite-plugin-html-inject-commands v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

vite-plugin-html-inject-commands

npm version npm downloads bundle size codecov license

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 or pnpm test

License

Published under the MIT license. Made by @byronogis and community 💛


🤖 auto updated with automd

0.0.1

1 year ago