vite-plugin-package-version
Version:
vite plugin to load package version into env
27 lines (17 loc) • 612 B
Markdown
# vite-plugin-package-version
[](https://www.npmjs.com/package/vite-plugin-package-version)
**Note: this plugin requires `vite@^2.0.0-beta.69`**.
Load package version of your package.json into your [vite](https://github.com/vitejs/vite) environment.
Will inject `import.meta.env.PACKAGE_VERSION` with the version specified in your package.json.
## Installation
```
npm i vite-plugin-package-version
```
## Usage
```js
// vite.config.js
import version from 'vite-plugin-package-version';
export default {
plugins: [version()],
};
```