lonely-lockley / archinsight

Simplicity in Code, Power in Design
https://archinsight.org
GNU Affero General Public License v3.0
51 stars 5 forks source link

Switched to Vaadin 24, Jetty 12 and Vite #64

Closed lonely-lockley closed 8 months ago

lonely-lockley commented 8 months ago

Web Workers are compiled, but not minified. Lots of fixes must be made to Editor-UI

lonely-lockley commented 8 months ago

This PR waits for it's hero to make it work. Addresses #58

lonely-lockley commented 8 months ago

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