Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Conversation

@pano9000
Copy link
Contributor

@pano9000 pano9000 commented Mar 27, 2025

WIP This PR aims to:

  • use webpack to copy and bundle the excalidraw required fonts
  • use webpack for bundling, so that we can move excalidraw to devDeps

the latter will save us ~69 MB of disk space in the final output (currently the @excalidraw node_modules folder weighs 82MB overall, the fonts, which we copy to app-dist weigh 13MB -> so 69MB of saving :-))

to be used for copying excalidraw fonts as assets
this will now end up in "src/public/app-dist/excalidraw/fonts/"

excalidraw *needs* the fonts to be in a folder called "fonts" as it appends the "EXCALIDRAW_ASSET_PATH" variable with "fonts" automatically -> therefore switch names around to fix the issue
used for the fonts excalidraw requires
it is bundled by webpack now
these are only used for excalidraw and are bundled by webpack now
@pano9000
Copy link
Contributor Author

asset copying and loading works nicely:
grafik

now just need to run some builds and test, if moving excalidraw/react/react-dom to devDeps did NOT break anything

@pano9000 pano9000 marked this pull request as ready for review March 28, 2025 07:16
@pano9000
Copy link
Contributor Author

pano9000 commented Mar 28, 2025

I could not see any issues with my locally build "webpack only" version :-)

There were two small "issues", which are present in the previous version as well:
(this is a screenshot from this night's nightly build — same thing happens in my "webpack only" version):
grafik

a) excalidraw also tries to load some other fonts and fails with a 404 → TriliumNext/Trilium#5596
b) it shows "Failed to use workers for subsetting, falling back to the main thread." → TriliumNext/Trilium#5597

I'll create separate issues for these so that we can track and fix them eventually

@eliandoran eliandoran merged commit 83890ba into develop Mar 28, 2025
5 checks passed
@eliandoran eliandoran deleted the build_webpack-excalidraw-font branch March 28, 2025 20:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants