49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('react-syntax-highlighter') || id.includes('refractor') || id.includes('prismjs')) {
|
|
return 'vendor-highlight'
|
|
}
|
|
if (id.includes('recharts') || id.includes('d3-') || id.includes('victory-vendor')) {
|
|
return 'vendor-charts'
|
|
}
|
|
if (id.includes('framer-motion') || id.includes('/node_modules/motion/')) {
|
|
return 'vendor-motion'
|
|
}
|
|
if (id.includes('node_modules')) {
|
|
return 'vendor'
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 5174,
|
|
proxy: {
|
|
'/api': {
|
|
target: process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
},
|
|
'/v1': {
|
|
target: process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
},
|
|
'/status': {
|
|
target: process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|