feat(appliance): initial release of MERICA standalone appliance v1.0.0
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import path from 'path';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, path.resolve(__dirname, '..'), '');
|
||||
const backendPort = env.FASTAPI_PORT || 8000;
|
||||
const backendHost = env.FASTAPI_HOST === '0.0.0.0' ? 'localhost' : (env.FASTAPI_HOST || 'localhost');
|
||||
const frontendPort = parseInt(env.VITE_PORT || '5173', 10);
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
react(),
|
||||
tailwindcss()
|
||||
],
|
||||
server: {
|
||||
port: frontendPort,
|
||||
host: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: `http://${backendHost}:${backendPort}`,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: './src/setupTests.js'
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user