tapioca24 / p5.capture

🎬 super easy recording for p5.js animations
MIT License
230 stars 6 forks source link

Package and npm #26

Closed micvolo closed 1 year ago

micvolo commented 1 year ago

Hi, first of all thanks for your work!

i'm trying to make your library works as an npm package in my Vite Project (Astro). npm i p5.capture works well but it doesn't have a default export, so i have to import it in my project like that

    const sketch = (p5: P5) => {
        ... my setup and draw
    });
    new P5(sketch, container);

   // import your library
    await import('p5.capture')

but i get the error:

image

I've read that your library is limited only to one p5.js instance mode, and that's what i have I also tried to import it with the cdn with the same result.

Is there a way to make this import works?

Thanks for your time!!

tapioca24 commented 1 year ago

Hi, @micvolo. Thank you for reporting this one!

Sorry about that! Just to let you know, p5.capture doesn't currently support use with module bundlers. I'll try to improve that in the future, but for now, please keep that in mind. Thanks for your help, and please let me know if you have any other questions or issues!