Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 788 Bytes

README.md

File metadata and controls

44 lines (33 loc) · 788 Bytes

vite-plugin-version

NPM version

Get the version information from package.json, then automatically put the version file version.json in your project dist folder when packaging.

// package.json
{
  // ...
  "version": "0.0.1"
}
// dist/version.json
{
  "version": "0.0.1"
}

Install

npm i vite-plugin-version

Add plugin to your vite.config.ts:

// vite.config.ts
import { defineConfig } from 'vite'
import versionPlugin from 'vite-plugin-version'

export default defineConfig({
  plugins: [
    versionPlugin(),
  ],
})

License

MIT License © 2022 YRM