This repository was archived by the owner on Aug 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 </router-link >
88 </div >
99 <div class =" absolute bottom-8 text-slate-400 text-sm -translate-x-1/2 left-1/2" >
10- <a class =" whitespace-nowrap" href =" https://github.com/NaturalSelectionLabs" target =" _blank"
11- >@ Natural Selection Labs</a
12- >
10+ <div >
11+ <el-tooltip placement =" top" :content =" `v${appVersion} #${commitHash}`" > CrossSync </el-tooltip >
12+ </div >
13+ <div >
14+ <a class =" whitespace-nowrap" href =" https://github.com/NaturalSelectionLabs" target =" _blank" >
15+ @ Natural Selection Labs
16+ </a >
17+ </div >
1318 </div >
1419</template >
1520
1621<script setup lang="ts">
1722import logo from ' ../assets/logo.svg?raw' ;
23+
24+ const appVersion = __APP_VERSION__ ;
25+ const commitHash = __COMMIT_HASH__ ;
1826 </script >
1927<style scoped></style >
Original file line number Diff line number Diff line change @@ -6,3 +6,7 @@ declare module '*.vue' {
66 const component : DefineComponent < { } , { } , any > ;
77 export default component ;
88}
9+
10+ // Version related
11+ declare const __APP_VERSION__ : string ;
12+ declare const __COMMIT_HASH__ : string ;
Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ import { crx } from '@crxjs/vite-plugin';
99import manifest from './manifest' ;
1010import { viteCommonjs } from '@originjs/vite-plugin-commonjs' ;
1111
12+ import ChildProcess from 'child_process' ;
13+
1214// const production = process.env.NODE_ENV === 'production';
1315
16+ const appVersion = JSON . stringify ( process . env . npm_package_version ) ;
17+ const commitHash = ChildProcess . execSync ( 'git rev-parse --short HEAD' ) . toString ( ) ;
18+
1419export default defineConfig ( {
1520 build : {
1621 rollupOptions : {
@@ -53,4 +58,8 @@ export default defineConfig({
5358 } ,
5459 } ) ,
5560 ] ,
61+ define : {
62+ __APP_VERSION__ : appVersion ,
63+ __COMMIT_HASH__ : commitHash ,
64+ } ,
5665} ) ;
You can’t perform that action at this time.
0 commit comments