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

Rewrite build scripts and introduce a bundler #114

Open
marcofugaro opened this issue Jun 18, 2020 · 4 comments
Open

Rewrite build scripts and introduce a bundler #114

marcofugaro opened this issue Jun 18, 2020 · 4 comments

Comments

@marcofugaro
Copy link

Hey, I could contribute to this library and rewrite it using ES6 imports + rollup like three.js is doing.

This could be the "clean" way to fix #78.

Are you interested?

@spite
Copy link
Owner

spite commented Jun 18, 2020

Yes, please. I've been trying to understand the latest landscape on modules across browser and node and i'm even more confused than before. I nowadays only code ES6 modules, no npm dependencies. I've found that node 14 has ES6 imports, but then require doesn't work. So if anyone can draft what the best, most straightforward way of delivering libraries is, i'll be very thankful.

@marcofugaro
Copy link
Author

Yes, please. I've been trying to understand the latest landscape on modules across browser and node and i'm even more confused than before.

😆

Sure! Do you prefer one big PR or multiple smaller PRs?

@marcofugaro
Copy link
Author

marcofugaro commented Jun 18, 2020

Three.js is using ES6 imports, they aren't actually node 14 imports, they work in node only thanks to the rollup bundler, the most common bundler used for libraries (webpack and parcel are more for projects).

It is good practice to write a library using ES6 imports instead of requires if the library target is the browser, since they're supported natively. However the bundler takes the library code and puts it all together in a single umd (Universal Module Definition) file which works everywhere, node or browser.

If you want to read more: https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c

Hope I didn't confuse you even more. 😄

@philipswan
Copy link

So was any progress made?
If not:
Sprite, do you commit to reviewing and merging the PR(s) if Marcofugaro creates them?
Marcofugaro, are you still willing to create the PR(s)?
Is there anything else that either of you need?

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

3 participants