- Updated vite config to export the package.json version as env variable - Added src/helpers/envHelper.js - Updated some constants to support being set by the .env file - Renamed Constants.sceneryFiles.fetchDisable to enableBuiltIn
23 lines
515 B
JavaScript
23 lines
515 B
JavaScript
import { defineConfig, loadEnv } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import fs from 'fs';
|
|
|
|
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '');
|
|
|
|
return {
|
|
base: env.VITE_BASE || '/',
|
|
plugins: [
|
|
react(),
|
|
],
|
|
define: {
|
|
'import.meta.env.VITE_APP_VERSION': JSON.stringify(packageJson.version),
|
|
},
|
|
build: {
|
|
target: 'es2015',
|
|
},
|
|
};
|
|
});
|