diff --git a/src/dashboard/scoreko-dev/views/About.vue b/src/dashboard/scoreko-dev/views/About.vue index 91f4cc4..3a55bfe 100644 --- a/src/dashboard/scoreko-dev/views/About.vue +++ b/src/dashboard/scoreko-dev/views/About.vue @@ -1,9 +1,124 @@ diff --git a/src/types/vite-env.d.ts b/src/types/vite-env.d.ts index 11f02fe..a6704e7 100644 --- a/src/types/vite-env.d.ts +++ b/src/types/vite-env.d.ts @@ -1 +1,9 @@ /// + +interface ImportMetaEnv { + readonly PACKAGE_VERSION: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/vite.config.ts b/vite.config.ts index 722fad9..0cc9506 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,12 +1,18 @@ import { quasar, transformAssetUrls } from '@quasar/vite-plugin'; import vue from '@vitejs/plugin-vue'; +import { readFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vite'; import checker from 'vite-plugin-checker'; import NodeCGPlugin from 'vite-plugin-nodecg'; +const packageJson = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8')) as { version: string }; + // https://vitejs.dev/config/ export default defineConfig({ + define: { + 'import.meta.env.PACKAGE_VERSION': JSON.stringify(packageJson.version), + }, plugins: [ vue({ template: { transformAssetUrls } }), quasar({