🚀 perf(vite): remove visactor manual chunk to avoid preloading on Home

Home was unexpectedly loading the `visactor-*.js` bundle on first paint. This
happened because the Vite manualChunks entry created a standalone vendor
chunk for VisActor, which Vite then preloaded on the initial route.

What’s changed
- Removed `visactor` from `build.rollupOptions.output.manualChunks` in `web/vite.config.js`.

Why
- Prevents VisActor from being preloaded on the Home page.
- Restores the intended behavior: VisActor loads only when the Dashboard (data
  analytics) is visited.

Impact
- Smaller initial payload and fewer network requests on Home.
- No functional changes to charts; loading behavior is now route-driven.

Test plan
- Build the app: `cd web && npm run build`.
- Open the preview and visit `/`: ensure no `visactor-*.js` is requested.
- Navigate to `/console` (Dashboard): ensure `visactor-*.js` loads as expected.
This commit is contained in:
t0ng7u
2025-08-23 01:54:32 +08:00
parent 8b7384e47f
commit bd166b2f77

View File

@@ -60,7 +60,6 @@ export default defineConfig({
manualChunks: {
'react-core': ['react', 'react-dom', 'react-router-dom'],
'semi-ui': ['@douyinfe/semi-icons', '@douyinfe/semi-ui'],
visactor: ['@visactor/react-vchart', '@visactor/vchart'],
tools: ['axios', 'history', 'marked'],
'react-components': [
'react-dropzone',