File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1- declare const __BUILD_TIME__ : string ;
2-
31export const DEFAULT_JSON = `{
42 "name": "JSON Formatter",
5- "version": "1.0.0 ",
3+ "version": "${ __BUILD_VERSION__ } ",
64 "description": "A beautiful JSON formatting tool",
75 "author": "const",
86 "site": "https://json.const.site",
Original file line number Diff line number Diff line change @@ -2,3 +2,5 @@ declare module '*.svg' {
22 const content : string ;
33 export default content ;
44}
5+ declare const __BUILD_TIME__ : string ;
6+ declare const __BUILD_VERSION__ : string ;
Original file line number Diff line number Diff line change 11import { defineConfig } from 'vite' ;
22import react from '@vitejs/plugin-react' ;
3+ import packageJson from './package.json' ;
34
45// https://vitejs.dev/config/
56export default defineConfig ( {
@@ -8,5 +9,6 @@ export default defineConfig({
89 __BUILD_TIME__ : JSON . stringify (
910 new Date ( ) . toLocaleString ( 'zh-CN' , { timeZone : 'Asia/Shanghai' } ) ,
1011 ) ,
12+ __BUILD_VERSION__ : JSON . stringify ( packageJson . version ) ,
1113 } ,
1214} ) ;
You can’t perform that action at this time.
0 commit comments