Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yrming/vite-plugin-version
Automatically put the version file in your project dist folder
https://github.com/yrming/vite-plugin-version
version vite vite-plugin vite-plugin-version vitejs
Last synced: about 1 month ago
JSON representation
Automatically put the version file in your project dist folder
- Host: GitHub
- URL: https://github.com/yrming/vite-plugin-version
- Owner: yrming
- License: mit
- Created: 2022-07-15T05:44:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-13T02:46:30.000Z (about 1 year ago)
- Last Synced: 2024-11-15T03:12:31.752Z (about 2 months ago)
- Topics: version, vite, vite-plugin, vite-plugin-version, vitejs
- Language: TypeScript
- Homepage:
- Size: 71.3 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-version
[![NPM version](https://img.shields.io/npm/v/vite-plugin-version?color=a1b858&label=)](https://www.npmjs.com/package/vite-plugin-version)
Get the `version` information from `package.json`, then automatically put the version file `version.json` in your project dist folder when packaging.
```json
// package.json
{
// ...
"version": "0.0.1"
}
```
```json
// dist/version.json
{
"version": "0.0.1"
}
```## Install
```bash
npm i vite-plugin-version
```Add plugin to your `vite.config.ts`:
```ts
// vite.config.ts
import { defineConfig } from 'vite'
import versionPlugin from 'vite-plugin-version'export default defineConfig({
plugins: [
versionPlugin(),
],
})```
## License
[MIT](./LICENSE) License © 2022 [YRM](https://github.com/yrming)