40 lines
983 B
TypeScript
40 lines
983 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 650,
|
|
rollupOptions: {
|
|
onwarn(warning, defaultHandler) {
|
|
if (
|
|
warning.code === 'INVALID_ANNOTATION'
|
|
&& warning.id?.includes('@microsoft/signalr')
|
|
) {
|
|
return
|
|
}
|
|
defaultHandler(warning)
|
|
},
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('echarts') || id.includes('zrender')) {
|
|
return 'charts'
|
|
}
|
|
if (id.includes('reactflow') || id.includes('@reactflow')) {
|
|
return 'flow'
|
|
}
|
|
return undefined
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|