45 lines
1 KiB
JavaScript
45 lines
1 KiB
JavaScript
import react from '@vitejs/plugin-react'
|
|
import { defineConfig } from 'vite'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules/three')) {
|
|
return 'three'
|
|
}
|
|
if (id.includes('node_modules/gsap')) {
|
|
return 'gsap'
|
|
}
|
|
if (id.includes('/webgl/hero-atmosphere/')) {
|
|
return 'hero-atmosphere'
|
|
}
|
|
if (id.includes('node_modules/react-router') || id.includes('node_modules/react-dom')) {
|
|
return 'vendor-react'
|
|
}
|
|
if (id.includes('node_modules/axios')) {
|
|
return 'vendor-http'
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'node',
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
'/media': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|