natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
1.08k stars 60 forks source link

Using a custom path for local icons instead of `/src/icons`? #38

Closed RobertAKARobin closed 9 months ago

RobertAKARobin commented 2 years ago

It looks like /src/icons is hardcoded into the loader:

https://github.com/natemoo-re/astro-icon/blob/4cfc1badfb5978829c1dfeb5b56491238a3a8e74/packages/core/lib/utils.ts#L189

It would be nice if this was configurable. :)

Specifically I'd like to import from /public, if possible.

stramel commented 1 year ago

@RobertAKARobin I think this is definitely something we can improve upon. Making the path configurable or allowing for specifying custom paths would be useful.

However, I would caution you about using the /public folder as it could add to your total build size since all assets in the /public folder are intended to not need processing and are emitted as-is to the final build. You can read more here