Files
shop-server/client/vite.config.ts
T
2026-05-13 22:07:46 +05:00

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,
},
},
},
})