40 lines
756 B
TypeScript
40 lines
756 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
// Environment-specific configuration
|
|
const envConfig = {
|
|
local: {
|
|
port: 5174,
|
|
strictPort: false,
|
|
},
|
|
dev: {
|
|
port: 9501,
|
|
strictPort: false,
|
|
},
|
|
test: {
|
|
port: 9502,
|
|
strictPort: false,
|
|
},
|
|
uat: {
|
|
port: 5176,
|
|
strictPort: false,
|
|
},
|
|
}
|
|
|
|
const serverConfig = envConfig[mode as keyof typeof envConfig] || envConfig.local
|
|
|
|
return {
|
|
plugins: [
|
|
react(),
|
|
tailwindcss()
|
|
],
|
|
server: serverConfig,
|
|
define: {
|
|
__APP_ENV__: JSON.stringify(mode),
|
|
},
|
|
}
|
|
})
|