kirbyup
kirbyup copied to clipboard
Asset strategy
Currently all assets imported in the frontend portion are included in the JS/CSS files as data URLs. This means that importing a single image can blow up the size of the JS to be parsed and executed to multiple MBs!
Would be great to somehow skip inlining the assets, but it doesn't appear that easy to solve, as the problematic behavior is built into Vite and not configurable:
- https://vitejs.dev/config/build-options.html#build-assetsinlinelimit
- https://github.com/vitejs/vite/issues/4454
- https://github.com/vitejs/vite/issues/3295
- https://github.com/vitejs/vite/pull/5028
Optimal would be some integrations so assets are loaded from the plugin's assets/
folder which Kirby automagically copies to the /media
directory: https://getkirby.com/docs/guide/plugins/plugin-basics#plugin-assets