johannschopplich / kirbyup

🆙 Official bundler for Kirby Panel plugins
https://kirbyup.getkirby.com
MIT License
51 stars 3 forks source link

Asset strategy #20

Open jonaskuske opened 2 years ago

jonaskuske commented 2 years ago

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:

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

johannschopplich commented 2 years ago

Kirby actually copies assets from a plugin's assets folder to the media folder already.

As it says in your opening post. Pardon me. 😅