If it's just about delivering a few small “icons” - (why not use fonts? ) - and if the server is serving gzipped files, you can use base64, for example.
Otherwise, if the selection is not immediately displayed, you can also add img tags (with display: none
) to the previous HTML. Another way is to add image objects to the DOM and wait for .onload
before displaying the component (this approach is used by the libraries you specify).
As far as I can imagine, a web package or reaction cannot do anything special for you here. This is something on the client side, and these are just tools to implement your own preload API (or even use existing APIs in JS / TS, React, Angular, ......)
source share