Fix version build
This commit is contained in:
parent
f9d9807cee
commit
dea9078379
|
@ -103,7 +103,7 @@ const Layout = () => {
|
|||
children={<Outlet />}
|
||||
items={items}
|
||||
Right={Right}
|
||||
version={__APP_VERSION__}
|
||||
version={import.meta.env.PACKAGE_VERSION}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
/// <reference types='vite/client' />
|
||||
|
||||
declare const __APP_VERSION__: string;
|
||||
|
||||
interface ImportMetaEnv {
|
||||
VITE_CODEX_API_URL: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly PACKAGE_VERSION: string;
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"noEmit": true
|
||||
"noEmit": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
"include": ["vite.config.ts", "./package.json"]
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vite";
|
||||
import packageJson from "./package.json";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [TanStackRouterVite(), react()],
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
|
||||
"import.meta.env.PACKAGE_VERSION": JSON.stringify(packageJson.version),
|
||||
},
|
||||
build: {
|
||||
sourcemap: true,
|
||||
|
|
Loading…
Reference in New Issue