Open fkaris opened 4 years ago
What does your network tab in dev tools show when you try to load an icon?
here you go.
@fkaris This works for me:
<script type="module" src="node_modules/ionicons/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="node_modules/ionicons/dist/ionicons/ionicons.js"></script>
You can just copy the node_modules/ionicons/dist/ionicons
to your public folder, and add following code in your index.html
<script src="/ionicons/ionicons.esm.js" type="module"></script>
<script nomodule src="/ionicons/ionicons.js"></script>
It's work fine for me.
Regarding the 2nd script tag with the nomodule
attribute (fallback for older browsers without ES6 modules support): Since Ionicons v5.3.0 the file node_modules/ionicons/dist/ionicons/ionicons.js
is not present anymore. Was the fallback simply removed meanwhile or was it moved to a different file? The official instructions only mention v4.7.4 which still included this file. Last version that included the file seems to be 5.2.3.
The proposed solution to copy the node_modules/iconicons/dist
folder to the assets folder is still accessing the server via Internet, just that it's our own server instead of the unpkg.com server. You can see the GET requests for individual icons in the DevTools, which happen only at the moment the icon needs to be displayed (in a SPA app, this can be even after the app's code has been downloaded and we started working offline).
Is there a way to use an icon font as we used to be able in version 4? Like this:
<link href="https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.min.css" rel="stylesheet">
So it is a single download.
Help...
Seems impossible to preload ionicons for offline usage. Switching to Font Awesome. Thanks
Hello team, thank you for the good work, unfortunately i am unable to find a solution to using ionicons offline here is my code and the preview. any guidance is welcome thanks.
Which file do i refrence to get them to work offline?