Closed lonely-lockley closed 8 months ago
This PR waits for it's hero to make it work. Addresses #58
The problem here is that Vite does not eliminate dead code effectively and can't inline ttf fonts as webpack does. This is the reason # 1 for build crash
[ERROR] No loader is configured for ".ttf" files: node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf
node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css:9:6:
9 │ src: url(./codicon.ttf) format("truetype");
╵ ~~~~~~~~~~~~~~~~~~
issue
Build starts to crash if any monaco dependency is present in module imports. The reason # 2 - is that Vite does not eliminate dead code effectively - it includes complete module to wrokers file making it HUGE. For example, insight.worker.bundle.js size is 1.7MB even without monaco. It seems that some node backend dependecies are included into worker leading to undefined
errors in production.
Probably, there IS a solution: make gradle script build web workers with webpack before Vite starts it's job
Web Workers are compiled, but not minified. Lots of fixes must be made to Editor-UI