Files
Jellystat/vite.config.js
c4lyp5o 3ffb21f8b8 feat: change webpack to vite
changed all extensions from js to jsx
added proxies in vite config
set up chunk for smaller distribution size
remove setupProxy
remove reportWebVitals
2023-11-07 16:44:45 +08:00

34 lines
931 B
JavaScript

import { defineConfig, splitVendorChunkPlugin } from 'vite';
import react from '@vitejs/plugin-react-swc';
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3000,
proxy: {
'/api': 'http://localhost:3003',
'/proxy': 'http://localhost:3003',
'/stats': 'http://localhost:3003',
'/sync': 'http://localhost:3003',
'/auth': 'http://localhost:3003',
'/backup': 'http://localhost:3003',
'/logs': 'http://localhost:3003',
'/socket.io': 'http://localhost:3003',
'/swagger': 'http://localhost:3003',
'/utils': 'http://localhost:3003',
},
},
target: ['es2015'],
rollupOptions: {
output: {
manualChunks: {
react: ['react'],
axios: ['axios'],
'react-router-dom': ['react-router-dom'],
'react-toastify': ['react-toastify'],
},
},
},
plugins: [react(), splitVendorChunkPlugin()],
});