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'), }, }, base: './', build: { outDir: 'dist', emptyOutDir: true, rollupOptions: { external: ['capacitor-nodejs'], }, }, server: { port: 5173, strictPort: true, proxy: { '/api/yts': { target: 'https://yts.lt/api/v2', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/yts/, ''), secure: false, timeout: 30000, proxyTimeout: 30000, }, '/api/eztv': { target: 'https://eztv.tf/api', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/eztv/, ''), secure: false, timeout: 30000, proxyTimeout: 30000, }, '/api/tmdb': { target: 'https://api.themoviedb.org/3', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/tmdb/, ''), secure: false, timeout: 30000, proxyTimeout: 30000, }, '/api/rarbg': { target: 'https://torrentapi.org', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/rarbg/, '/pubapi_v2.php'), secure: false, timeout: 30000, proxyTimeout: 30000, }, }, }, define: { 'process.env': {}, }, });