Mitcheljager / svelte-confetti

Confetti in Svelte! Celebrate things with some extra flair. Animates using just HTML and CSS meaning it can work with SSR in SvelteKit!
https://mitcheljager.github.io/svelte-confetti/
265 stars 10 forks source link

Improve install instructions #2

Closed bersling closed 1 year ago

bersling commented 1 year ago

Change from npm install --save svelte-confetti to npm install --save-dev svelte-confetti

Mitcheljager commented 1 year ago

Could you explain why? I understand that theoretically everything in Svelte is a devDependency since it's all compiled, but I think the distinction still makes sense.

LeoDog896 commented 1 year ago

Could you explain why? I understand that theoretically everything in Svelte is a devDependency since it's all compiled, but I think the distinction still makes sense.

Dev dependencies are used for sites - e.g. if you're making a Svelte Library, generally, svelte-confetti would be used as a display for the Demo site, not the library itself. In the case of a normal Svelte / SvelteKit site, dev dependencies are preferred (simply as a style reason), and are generally standard across different libraries.

(Forwarding to @Mitcheljager)

xpat commented 1 year ago

I second this pull request. After running npm install --save svelte-confetti as indicated in the instructions, I got an error and my Cloudflare deployment failed but not the case after running npm install -D svelte-confetti. Advice I followed on Discord to avoid this error is to install as a devDependency and that worked. It's the only thing I changed and I went from failed deployment to successful.

My error message was: [vite]: Rollup failed to resolve import "svelte-confetti" from "/opt/buildhome/repo/src/routes/+layout.svelte".

Mitcheljager commented 1 year ago

Fair enough, I'll merge it in!