migliori / universal-icon-picker

Vanilla JS Icon Picker for any Icon Library
https://universal-icon-picker.miglisoft.com
MIT License
79 stars 12 forks source link

Asset manager does not work with "iconPickerUrl" #8

Closed juniwalk closed 1 year ago

juniwalk commented 1 year ago

Hello, I just implemented your icon picker which just saved me around 250MB of disk space compared to old one, thanks! :D

I wanted to ask, is the use of "iconPickerUrl" necessary? I have asset manager that moves assets I want to include in my page outside their original folder and that of course breaks this.

If there would be an option to set custom paths, or manually load things and icon picker would still work that would be great.

migliori commented 1 year ago

Hello,

The iconPickerUrl uses document.currentScript.src to get the URL of the iconpicker (assets/js/universal-icon-picker.min.js)

It allows to locate the assets folder URL then load the dependencies (iconpîcker CSS, font files, images) without hassle. You just need to keep the structure of the assets folder and its contents, which I think is good practice.

If your dependency manager forces you to move the dependencies of a plugin into other folders, you should explain to him that this is not a good idea at all.

juniwalk commented 1 year ago

Haven't had issue till now to be honest, but good thing it's my work so I can change it. Thanks.