-
Notifications
You must be signed in to change notification settings - Fork 489
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
Allow import/require in Player.js for modularity of user code #99
Comments
Hello @jayandcatchfire and thanks for creating this issue. I'm open to receive a PR that implements this. |
I'll be happy to take a crack at it, but I can't guarantee anything forthcoming immediately. So much to do and so little time. So if anyone else sees this ticket and wants to try their hand, please do! |
Please comment here if you grab this so I mark it as claimed. |
looks like this can be achieved using
this requires running |
Pleasee i need some of this!!!! :))))) |
@netzulo you can work around it by importing your code as a string and call eval(code) |
I published a tutorial on how this can be achieved using a module bundler here. |
@olistic in addition to your module bundler solution, in order to automatically remove the two last lines, you can run: |
News on this? If a contributor can point me on the right direction I'm available to implement it this weekend |
Originally mentioned in #39, it would be a great improvement to code organization if users like myself could split our code into modules (*.js and *.mjs) that could be loaded into the Player.js file (via
import
and/orrequire
).It doesn't appear that this is supported at the moment. That means that a lot of code ends up in Player.js. At various times while playing, I've been in the neighborhood of 250 lines.
The text was updated successfully, but these errors were encountered: