feat: display current version

This commit is contained in:
kunish 2023-09-03 18:16:09 +08:00
parent 0a8312d87c
commit 1765adacda
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
7 changed files with 17 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{
"name": "metacubexd",
"version": "1.58.0",
"description": "Clash-Meta Dashboard",
"description": "Clash.Meta Dashboard, The Official One, XD",
"license": "MIT",
"type": "module",
"scripts": {

View File

@ -156,11 +156,11 @@ export const Header = () => {
</div>
<a
class="text-xl font-bold normal-case"
class="whitespace-nowrap text-xl font-bold uppercase"
href="https://github.com/metacubex/metacubexd"
target="_blank"
>
metacubexd
metacube, xd
</a>
</div>

View File

@ -340,6 +340,8 @@ export default () => {
<DNSQueryForm />
<ConfigForm />
<ConfigForXd />
{import.meta.env.version}
</div>
)
}

7
src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
interface ImportMetaEnv {
readonly version: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}

View File

@ -4,6 +4,7 @@
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",

View File

@ -1,11 +1,15 @@
import { defineConfig, splitVendorChunkPlugin } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import solidPlugin from 'vite-plugin-solid'
import pkgJSON from './package.json'
export default defineConfig({
base: './',
build: { chunkSizeWarningLimit: 1000 },
resolve: { alias: { '~': '/src' } },
define: {
'import.meta.env.version': JSON.stringify(pkgJSON.version),
},
plugins: [
solidPlugin(),
splitVendorChunkPlugin(),