GTARH_Fonctionnel_V1
This commit is contained in:
34
vite.config.js
Normal file
34
vite.config.js
Normal file
@@ -0,0 +1,34 @@
|
||||
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,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user