Use `import`?
canadaduane opened this issue · 8 comments
I'm using Parcel
to package JS code and it uses import
instead of require
. As a result, I'm getting "Error: Cannot find module 'three'" when trying to use Partykals.
Is there a way to make this awesome library compatible with standard import
as well?
Not sure if this is the right way, but it seems to be working for our project:
Hi @canadaduane glad to hear this fork works for you, unfortunately I don't want to merge it back because it breaks the way I work today with require.
If you find a trick to make the distributed file support both import and standalone, or alternatively something that works for both require and import, feel free to do a pr.
Meanwhile I'm closing this issue as not supported.
Thanks :)
Just wanted to put another voice out there requesting import support. I'm currently using the fork by @MageStudio
Oh wow, forks all around! I didn't see that one or I would have used it.
Hi @skrichten , @canadaduane , I'm not against supporting import (the opposite :)) I'm just not using it myself so I'm not going to invest time in it, but if you want to take it on yourself and do a PR that will not break the standalone method, I'll be happy to merge it in. (standalone = import as separate js tag after THREE).
Cheers!
Just wanted to put another voice out there requesting import support. I'm currently using the fork by @MageStudio
How did you get this to work with import statements? I'm using webpack and not able to hook this up.
Thanks! :)