pms-front-react/vite.config.ts

24 lines
596 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path' // Import path module
// https://vitejs.dev/config/
export default defineConfig({
// base: '/pms-react-new/', // Set base URL if deploying to a sub-path
plugins: [react()],
resolve: { // Add resolve configuration
alias: {
'@': path.resolve(__dirname, './src'), // Alias @ to ./src
},
},
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}
})