mirror of
https://github.com/jlengrand/Maestro.git
synced 2026-03-10 08:31:19 +00:00
26 lines
743 B
TypeScript
26 lines
743 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
import { readFileSync } from 'fs';
|
|
|
|
// Read version from package.json as fallback
|
|
const packageJson = JSON.parse(readFileSync(path.join(__dirname, 'package.json'), 'utf-8'));
|
|
// Use VITE_APP_VERSION env var if set (during CI builds), otherwise use package.json
|
|
const appVersion = process.env.VITE_APP_VERSION || packageJson.version;
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
root: path.join(__dirname, 'src/renderer'),
|
|
base: './',
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(appVersion),
|
|
},
|
|
build: {
|
|
outDir: path.join(__dirname, 'dist/renderer'),
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
},
|
|
});
|