35 lines
764 B
TypeScript
35 lines
764 B
TypeScript
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import react from '@vitejs/plugin-react'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const rootDir = fileURLToPath(new URL('.', import.meta.url))
|
|
const projectRoot = path.resolve(rootDir, '..')
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(rootDir, 'src'),
|
|
'@shared': path.resolve(projectRoot, 'shared'),
|
|
},
|
|
},
|
|
server: {
|
|
fs: {
|
|
allow: [projectRoot],
|
|
},
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:3333',
|
|
changeOrigin: true,
|
|
},
|
|
'/uploads': {
|
|
target: 'http://127.0.0.1:3333',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|