Skip to content

Conversation

@christian-bromann
Copy link
Contributor

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:

  • I can import a setAssetPath method from ionicons
  • it impacts where the SVGs are getting loaded from

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

fixes #1302

@liamdebeasi liamdebeasi changed the base branch from main to feature-7.4 May 1, 2024 18:09
@liamdebeasi liamdebeasi changed the base branch from feature-7.4 to main May 1, 2024 18:09
@christian-bromann christian-bromann changed the base branch from main to feature-7.4 May 1, 2024 18:45
@christian-bromann christian-bromann force-pushed the cb/export-setAssetPath branch from e7f12d6 to 15f239d Compare May 1, 2024 18:47
@christian-bromann christian-bromann force-pushed the cb/export-setAssetPath branch from 15f239d to 9850fd3 Compare May 1, 2024 18:48
@liamdebeasi liamdebeasi changed the title fix: export setAssetPath to give user a way to change that path feat: export setAssetPath May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: not clear how to use setAssetPath to load svg icons

2 participants