From 8261bd841e97bfbadef76f2a1f0ba5bb32b68bd2 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Fri, 6 Dec 2024 09:01:55 +0800 Subject: [PATCH] fix: remove VITE_APP_VERSION --- src/components/ReloadPrompt.tsx | 4 ++-- vite.config.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/ReloadPrompt.tsx b/src/components/ReloadPrompt.tsx index a20c02d..19f4b13 100644 --- a/src/components/ReloadPrompt.tsx +++ b/src/components/ReloadPrompt.tsx @@ -10,7 +10,7 @@ function ReloadPrompt() { updateServiceWorker, } = useRegisterSW({ onRegisteredSW(swUrl) { - console.log(`SW Registered: ${swUrl} (Version: ${import.meta.env.VITE_APP_VERSION})`); + console.log(`SW Registered: ${swUrl} (Version: ${import.meta.env.VITE_GIT_HASH})`); }, onRegisterError(error) { console.log('SW registration error', error); @@ -35,7 +35,7 @@ function ReloadPrompt() { toast.message( - `${t('pwa.newContent')} (${import.meta.env.VITE_APP_VERSION})`, + `${t('pwa.newContent')} (${import.meta.env.VITE_GIT_HASH})`, { action: { label: t('pwa.reload'), diff --git a/vite.config.ts b/vite.config.ts index 4077cb6..f32b571 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,7 +19,6 @@ export default defineConfig({ base: "/", define: { "import.meta.env.VITE_GIT_HASH": JSON.stringify(getGitHash()), - "import.meta.env.VITE_APP_VERSION": JSON.stringify(process.env.npm_package_version || "1.0.0"), }, plugins: [ react(),