diff options
Diffstat (limited to 'frontend/vite.config.ts')
| -rw-r--r-- | frontend/vite.config.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts new file mode 100644 index 0000000..c90383c --- /dev/null +++ b/frontend/vite.config.ts | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | import { defineConfig, loadEnv } from 'vite' | ||
| 2 | import react from '@vitejs/plugin-react' | ||
| 3 | import tailwindcss from '@tailwindcss/vite' | ||
| 4 | import path from 'path' | ||
| 5 | |||
| 6 | export default defineConfig(({ mode }) => { | ||
| 7 | // load env variables for the current mode (from .env, .env.development, etc.) | ||
| 8 | const env = loadEnv(mode, process.cwd(), '') | ||
| 9 | const API_TARGET = env.VITE_API_TARGET || 'https://lp.pektezol.dev/' | ||
| 10 | |||
| 11 | return { | ||
| 12 | plugins: [react(), tailwindcss()], | ||
| 13 | resolve: { | ||
| 14 | alias: { | ||
| 15 | '@api': path.resolve(__dirname, './src/api'), | ||
| 16 | '@components': path.resolve(__dirname, './src/components'), | ||
| 17 | '@css': path.resolve(__dirname, './src/css'), | ||
| 18 | '@customTypes': path.resolve(__dirname, './src/types'), | ||
| 19 | '@hooks': path.resolve(__dirname, './src/hooks'), | ||
| 20 | '@pages': path.resolve(__dirname, './src/pages'), | ||
| 21 | '@utils': path.resolve(__dirname, './src/utils'), | ||
| 22 | '@images': path.resolve(__dirname, './src/images'), | ||
| 23 | }, | ||
| 24 | }, | ||
| 25 | server: { | ||
| 26 | port: 3000, | ||
| 27 | proxy: { | ||
| 28 | '/api': { | ||
| 29 | target: API_TARGET, | ||
| 30 | changeOrigin: true, | ||
| 31 | }, | ||
| 32 | }, | ||
| 33 | }, | ||
| 34 | build: { | ||
| 35 | outDir: 'build', | ||
| 36 | }, | ||
| 37 | } | ||
| 38 | }) \ No newline at end of file | ||