35 lines
905 B
JavaScript
35 lines
905 B
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
import http from 'http'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
host: true,
|
|
port: 3014,
|
|
allowedHosts: ['mygta-rh.ensup-adm.net', 'localhost'],
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://gtarh-backend:3000',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
ws: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ''), // ✅ RETIRE /api
|
|
configure: (proxy, options) => {
|
|
options.agent = new http.Agent({ family: 4 });
|
|
}
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: false,
|
|
}
|
|
})
|