Skip to content

bazingaedward/vite-plugin-buildInfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-buildInfo

Add multiple Git information artifacts to the index.html file for the project build

<!doctype html>
<html lang="en">
<head>
  <meta name="git-branch" content="<branch>">
  <meta name="git-commitHash" content="<hash>">
  <meta name="git-tag" content="<tag>">
  <meta name="build-time" content="Wed Jun 19 2024 18:17:34 GMT+0800 (中国标准时间)">

  ...
</head>
<body>
<div id="app"></div>
</body>
</html>

Info List

  • branch: HEAD branch
  • hash: HEAD commit
  • tag: HEAD tag
  • build Time: Date

Insall

pnpm install vite-plugin-meta-info -D

Config

// vite.config.ts
import MetaInfoPlugin from 'vite-plugin-meta-info'

export default defineConfig({
    // ignore other config
    plugins: [
        // ignore other plugins
        MetaInfoPlugin()
    ]
    
})

About

Add git tag/branch/hash meta info for index.html

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published