Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use import? #5

Closed
canadaduane opened this issue Mar 8, 2020 · 8 comments
Closed

Use import? #5

canadaduane opened this issue Mar 8, 2020 · 8 comments

Comments

@canadaduane
Copy link

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?

@canadaduane
Copy link
Author

Not sure if this is the right way, but it seems to be working for our project:

ayanarra@1200be2

@RonenNess
Copy link
Owner

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 :)

@skrichten
Copy link

Just wanted to put another voice out there requesting import support. I'm currently using the fork by @MageStudio

@canadaduane
Copy link
Author

Oh wow, forks all around! I didn't see that one or I would have used it.

@RonenNess
Copy link
Owner

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!

@canadaduane
Copy link
Author

canadaduane commented Mar 11, 2020 via email

@NeoHoffa
Copy link

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! :)

@QuickMick
Copy link

#11

how about this? it creates two files now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants