vite plugin to load package version into env
Go to file
Simon Haugen 440d7583ab added files and folders to npmignore 2021-02-13 14:28:59 +01:00
example removed npm scope and updated package.json 2021-02-13 13:41:31 +01:00
src inject npm_package_version into vite env 2021-02-13 12:59:02 +01:00
.gitignore Initial commit 2021-02-13 10:24:24 +01:00
.npmignore added files and folders to npmignore 2021-02-13 14:28:59 +01:00
.prettierrc Initial commit 2021-02-13 10:24:24 +01:00
LICENSE Initial commit 2021-02-13 10:24:24 +01:00
README.md updated README.md 2021-02-13 14:11:15 +01:00
package-lock.json 0.0.2 2021-02-13 14:12:00 +01:00
package.json 0.0.2 2021-02-13 14:12:00 +01:00
tsconfig.json Initial commit 2021-02-13 10:24:24 +01:00

README.md

vite-plugin-package-version

npm

Note: this plugin requires vite@^2.0.0-beta.69.

Load package version of your package.json into your 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

// vite.config.js
import loadVersion from 'vite-plugin-package-version';

export default {
  plugins: [loadVersion()],
};