支持通过环境变量设置 VITE_APP_VERSION

This commit is contained in:
hi2hi 2024-12-05 10:14:28 +00:00
parent e4324b3916
commit 9ce4772585
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "nazhua", "name": "nazhua",
"version": "0.3.5", "version": "0.3.7",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@ -9,7 +9,7 @@ import packageJson from './package';
dotenv.config({ dotenv.config({
path: '.env.development.local', path: '.env.development.local',
}); });
process.env.VITE_APP_VERSION = packageJson.version; process.env.VITE_APP_VERSION = process.env.VERSION || packageJson.version;
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({