40 lines
935 B
JavaScript
40 lines
935 B
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react()
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
host: true,
|
|
port: 3014,
|
|
allowedHosts: [
|
|
'mygta-rh.ensup-adm.net',
|
|
'localhost'
|
|
],
|
|
hmr: {
|
|
protocol: 'ws',
|
|
host: 'mygta-rh.ensup-adm.net',
|
|
clientPort: 80,
|
|
},
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://172.20.0.2:1433', // ← backend Node, pas SQL Server
|
|
changeOrigin: true,
|
|
secure: false,
|
|
ws: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: false,
|
|
}
|
|
}) |