File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1+ declare const __APP_VERSION__ : string
12import { QueryClient } from '@tanstack/vue-query'
23import { persistQueryClient } from '@tanstack/query-persist-client-core'
34import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister'
@@ -21,5 +22,5 @@ persistQueryClient({
2122 queryClient,
2223 persister : asyncPersister ,
2324 maxAge : 7 * 24 * 60 * 60 * 1000 , // 永続化キャッシュの寿命
24- buster : 'v1' , // APIやスキーマが変わったら更新
25+ buster : __APP_VERSION__ , // package.json のバージョンを自動反映
2526} )
Original file line number Diff line number Diff line change 1+ import pkg from './package.json'
12import { fileURLToPath , URL } from 'node:url'
23
34import { defineConfig } from 'vite'
@@ -8,6 +9,9 @@ import { VitePWA } from 'vite-plugin-pwa'
89
910export default defineConfig ( ( { mode } ) => {
1011 return {
12+ define : {
13+ __APP_VERSION__ : JSON . stringify ( pkg . version ) ,
14+ } ,
1115 plugins : [
1216 vue ( ) ,
1317 vueDevTools ( ) ,
You can’t perform that action at this time.
0 commit comments