You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to have my app preload font files and background images, and I haven't found an ideal way to do so with Netjet.
Currently, the only way I've found to get Netjet to parse background images is to just shove <img src="image.jpg" style="display: none;"> into my DOM. And when it comes to fonts, I have to manually append a header to the route response, forgoing Netjet entirely.
The simplest solution seems to be to parse link preloaders from the DOM, giving you easy control of specific elements you want preloaded on each page without resorting to hackery.
For example, the following elements would be parsed: <link rel="preload" href="image.jpg" as="image"> <link rel="preload" href="font.woff" as="font">
This would also open the door to other types of files being preloaded, such as audio and video, given they're small enough.
The text was updated successfully, but these errors were encountered:
I'm currently trying to have my app preload font files and background images, and I haven't found an ideal way to do so with Netjet.
Currently, the only way I've found to get Netjet to parse background images is to just shove
<img src="image.jpg" style="display: none;">
into my DOM. And when it comes to fonts, I have to manually append a header to the route response, forgoing Netjet entirely.The simplest solution seems to be to parse link preloaders from the DOM, giving you easy control of specific elements you want preloaded on each page without resorting to hackery.
For example, the following elements would be parsed:
<link rel="preload" href="image.jpg" as="image">
<link rel="preload" href="font.woff" as="font">
This would also open the door to other types of files being preloaded, such as audio and video, given they're small enough.
The text was updated successfully, but these errors were encountered: