why is this js file so big?
why is this js file so big?

@hyrious
Because we didn't configure the manualChunks option in vite.config.ts. By default vite leaves it as empty (i.e. the same as rollup's default behavior). You can treat that as bundled all dependencies in node_modules. You can turn on the visualizer plugin to know what modules it includes.
Manually configuring chunks can be hard because you don't know which dependencies are not going to update. It could easily become a false-optimization.
Below are some important libraries that Flat is depending on, which should give you the reason about the vendors size:
| package | bundled size |
|---|---|
| agora-rtc-sdk-ng + agora-rtm-sdk | 1.1 MB + 0.5 MB |
| white-web-sdk | 2.3 MB |
| @netless/window-manager (video-js) | 1 MB |
| @netless/app-slide (pixi-js) | 1.6 MB |
| @netless/app-monaco (monaco-editor) | 0.3 MB |
| antd + @ant-design/icons | 1.2 MB + 0.7 MB |
Flat was created initially as an electron application which is filesize insensitive. We were focusing on product POC and tried to launch a workable product as fast as possible. After months of evolving we finally gained enough feedbacks from realworld tutors. The fundamental shap of Flat project I think has come to a level of stability.
Optimization is on the way and for a start, the giant refactoring PR that is merged yesterday splits the different functionalities into on-demand dynamic modules. This should improve the initial page load.