ionic-team / ionicons

Premium hand-crafted icons built by Ionic, for Ionic apps and web apps everywhere 🌎
http://ionicons.com
MIT License
17.39k stars 2.06k forks source link

feat: export setAssetPath #1372

Closed christian-bromann closed 2 weeks ago

christian-bromann commented 2 weeks ago

Ionicons never exports setAssetPath prevents users from actually changing given path. Exporting it makes Stencil to keep this function as part of the bundled runtime. I tested the change by using this HTML:

<script type="module" src="/node_modules/ionicons/dist/ionicons/ionicons.esm.js"></script>
<script type="module">
    import { setAssetPath } from '/node_modules/ionicons/dist/ionicons/index.esm.js';
    setAssetPath('/I/got/changed');
</script>
<ion-icon name="heart"></ion-icon>

I was able to verify that:

Note: I have also reported this as a bug in Stencil

fixes #1302