tonyketcham / p5-svelte

Easily add p5 sketches to a Svelte project 🍛 🌱
https://p5-svelte.netlify.app
MIT License
177 stars 7 forks source link

Fix missing exports condition #370

Open statox opened 9 months ago

statox commented 9 months ago

When building a project with dependencies:

"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"svelte": "^4.2.3",
"vite": "^5.0.0",

"p5-svelte": "^3.1.2",

We get the following warning:

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

p5-svelte@3.1.2

This MR reuses the example from the doc for this error to fix the warning and ensure this lib won't break in the future.

Using the svelte field in package.json to point at .svelte source files is deprecated and you must use a svelte export condition. vite-plugin-svelte 3 still resolves it as a fallback, but in a future major release this is going to be removed and without exports condition resolving the library is going to fail.


Btw thanks for this project it's super convenient :+1:

netlify[bot] commented 9 months ago

Deploy Preview for p5-svelte failed.

Name Link
Latest commit a55fd2c19b0451c49d815af6fb20aa6437be1748
Latest deploy log https://app.netlify.com/sites/p5-svelte/deploys/657de64a0c1567000887338e
womogenes commented 2 months ago

Came here to request the same fix. +1 for this PR :)

statox commented 2 months ago

Hey @rbrdl and @tonyketcham do you have any comments/questions/concerns about this MR?

I'm looking into this dependency again today and I would love to get it fixed because that's quite a nice wrapper. I see that the CI checks are all failing and that you have #371 which I think would be fixed with this MR. Let me know if I can be of any help :)