vite plugin to load package version into env
Go to file
Troplo 5b5e4ccf0b Update 'README.md' 2022-01-30 19:03:03 +11:00
__tests__ added tests 2021-04-22 22:52:14 +02:00
demo added tests 2021-04-22 22:52:14 +02:00
src Update 'src/index.ts' 2022-01-30 19:02:48 +11:00
.gitignore Initial commit 2021-02-13 10:24:24 +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 Update 'README.md' 2022-01-30 19:03:03 +11:00
jest.config.js added tests 2021-04-22 22:52:14 +02:00
package-lock.json 1.0.2 2021-05-05 20:54:49 +02:00
package.json 1.0.2 2021-05-05 20:54:49 +02: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 and import.meta.env.BUILD_DATE 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()],
};