mattjennings / svelte-pixi

Create PixiJS apps with Svelte
https://svelte-pixi.com
MIT License
112 stars 15 forks source link

how can add it to an existing sapper project? #2

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi. I have a svelte/sapper project and want to add pixi.js to it. how can I add pixi.js to my project?

mattjennings commented 4 years ago

I haven't tried it with Sapper, but you'd want to make sure Pixi and svelte-pixi components are only run on the client. You can check for process.browser in sapper to detect if you're on the client.

For what it's worth the state of this project is nothing more than a proof-of-concept, so it may not be worth going down that rabbit hole yet. I'd recommend just building off the example project