Gets the application version for the renderer process from build-time environment variable.
export const getAppVersion = (): string => { const importMeta = import.meta as ImportMeta & { env?: { VITE_APP_VERSION?: string; }; }; const rendererVersion = importMeta.env?.VITE_APP_VERSION; const nodeVersion = typeof process === "undefined" ? undefined : (process.env.VITE_APP_VERSION ?? process.env.npm_package_version); return rendererVersion ?? nodeVersion ?? "1.0.0";}; Copy
export const getAppVersion = (): string => { const importMeta = import.meta as ImportMeta & { env?: { VITE_APP_VERSION?: string; }; }; const rendererVersion = importMeta.env?.VITE_APP_VERSION; const nodeVersion = typeof process === "undefined" ? undefined : (process.env.VITE_APP_VERSION ?? process.env.npm_package_version); return rendererVersion ?? nodeVersion ?? "1.0.0";};
The current application version as a string.
Gets the application version for the renderer process from build-time environment variable.
Source