feat(docker): añadir Dockerfile para contenerizar la aplicación
This commit is contained in:
32
vite.config.ts
Normal file
32
vite.config.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
const apiTarget = env.VITE_API_URL || 'https://testapp.digitaltelecom.net';
|
||||
|
||||
return {
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: env.VITE_API_URL
|
||||
? undefined
|
||||
: {
|
||||
'/api': { target: apiTarget, changeOrigin: true, secure: true },
|
||||
'/auth': { target: apiTarget, changeOrigin: true, secure: true },
|
||||
'/contador': { target: apiTarget, changeOrigin: true, secure: true },
|
||||
'/ws': {
|
||||
target: apiTarget.replace(/^http/i, 'ws'),
|
||||
ws: true,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user