-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Correct use of p5.js with ES6? #1734
Comments
I'm sorry, I don't think there is at this time, unless you use p5 in "global mode" |
@albertovilva how is your sketch function triggered? How is setup() and draw() called? |
@designbyadrian his code resides in this repository: https://github.com/albertovilva/p5-tests. |
The p5 npm package is apparently not production-ready:
The p5 NPM package exports the non-minified p5 file. Why? I am looking for a way around this without losing my webpack workflow, so I tried the following:
Everything was going well until I realized
Solution:
@vilvadot did you notice your minified bundle size exceeding 1.2MB as well? |
So I set up a little starting project with Webpack interpreting ES6 with babel.
Im loving the way to work but I have a question. For example in this sketch:
As you can see I must prepend "p5" to all functions, since its not in the global namespace, is there a way to avoid this for the shake of cleaner and easier to write code?
The text was updated successfully, but these errors were encountered: