diff --git a/package.json b/package.json index d82e5ad..d1bf605 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/components/Header.tsx b/src/components/Header.tsx index febbafc..e74d379 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -156,11 +156,11 @@ export const Header = () => { - metacubexd + metacube, xd diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index 83b21de..1a9fd83 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -340,6 +340,8 @@ export default () => { + + {import.meta.env.version} ) } diff --git a/src/types.d.ts b/src/types/index.d.ts similarity index 100% rename from src/types.d.ts rename to src/types/index.d.ts diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..2dc7d14 --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1,7 @@ +interface ImportMetaEnv { + readonly version: string +} + +interface ImportMeta { + readonly env: ImportMetaEnv +} diff --git a/tsconfig.json b/tsconfig.json index 609895e..317af43 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "target": "ESNext", "module": "ESNext", "moduleResolution": "node", + "resolveJsonModule": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, "jsx": "preserve", diff --git a/vite.config.ts b/vite.config.ts index e1d5711..adfcdf9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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(),