Cweili / svelte-fa

Tiny FontAwesome component for Svelte
https://cweili.github.io/svelte-fa/
MIT License
398 stars 24 forks source link

update package.json for vite5 / svelte 3 #313

Closed benoitf closed 7 months ago

benoitf commented 9 months ago

hello,

first, I'm happy to use this library.

But recently I faced an issue with vite-plugin-svelte and vite5 When this library was made, these components were older :-)

Here is the issue: https://github.com/sveltejs/vite-plugin-svelte/issues/813

it seems svelte-fa is not following new recommended approach for svelte usage.

Running it now I can see

[vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

svelte-fa@3.0.4
Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

and here is the recommandation provided in the vite plugin svelte issue

My recommendation would be to switch to svelte-package , add "type": "module", add an "exports" map , add publint to verify their package.json is ok. And last but not least maybe don't do mixed exports (default and named) from the index file. Thats not great.

I don't know if you would accept such PR ?

Cweili commented 8 months ago

@benoitf Yes, please feel free to submit a PR!

notramo commented 8 months ago

@benoitf are you working on it?

benoitf commented 8 months ago

hello, I forgot I'm not working on it right now

stephenlrandall commented 8 months ago

@Cweili Example of another package that had to make similar changes: https://github.com/fedorovvvv/svelte-floating-ui/commit/a1f7bee81ed60a2dcbe143dfc4b0cefd48cde22a