0.0.5 • Published 3 years ago
vite-plugin-version-output v0.0.5
vite-plugin-version-output
Automatically insert the version in your project
Install
pnpm install -D vite-plugin-version-output
# OR yarn add -D vite-plugin-version-output
# OR npm install -D vite-plugin-version-outputUsage
// vite.config.ts
import { defineConfig } from 'vite'
import { vitePluginVersionOutput } from 'vite-plugin-version-output'
export default defineConfig({
plugins: [
vitePluginVersionOutput({
// name: 'test-app',
// version: '0.0.1',
json: {
enable: true,
fileName: 'version.json'
},
html: {
enable: true,
toMeta: true,
toConsole: true,
toGlobal: true
},
})
],
})Config
vite-plugin-version-output can be print application version in the Console or add <meta> in HTML element.
name- application name (name in package.jsonby default)version- application version (version in package.jsonby default)html- HTML output configenable- enable HTML output (trueby default)ifMeta- add \ in the \ (trueby default)ifConsole- print info in the Console (trueby default)ifGlobal- set a variable named `__${APPNAME}_VERSION__` in the window. (trueby default)
json- JSON output configenable- enable JSON output (trueby default)fileName- output file name (version.jsonby default) Then you can usevite-plugin-version-output! 🎉