-
Notifications
You must be signed in to change notification settings - Fork 6
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
Transpile JS or Use less modern syntax #3
Comments
I can have a look at this if you want to. |
@nico-martin uh yes please! |
I implemented it on a feature branch: https://github.com/nico-martin/color-description/tree/babel-transpile Oh and since there are now two "source" files, I added a What do you think? too much build logic? |
@nico-martin ups, look like it broke the tests :D I also think the package.json needs to be adapted, so browser and note will require the adequate version. |
Btw, esbuild is a great bundler. It’s extremely fast! |
@meodai Who needs test if your code works😊. No no, I will look into it. |
@wooorm sounds great! Do you want to have a look @nico-martin. I don't have any feelings towards the "slimness" of the build process ;) as long as |
Sure, I will add esbuild for a build process. But this will require some refactoring😊 |
@nico-martin what I also miss now: before I could work on the index file, an instantly see the result in the browser, what made it super easy to work on the class, now I have to build it every time. Not really a viable option imho. |
@wooorm It works, I will push soon, thanks so much. I am now looking up how I can set the main file in the package.json so the right one is loaded by the right env |
It now works. But I have a question: The --bundle argument now always bundles chroma-js in. That's fine for a browser package. But in when using |
@wooorm ok I guess all I needed is to not use --bundle ;D https://github.com/words/color-description/blob/main/package.json#L9 |
I’m personally on board of the ESM train. All packages I maintain are ESM only. I recently analyzed all of npm, which you might find interesting: https://twitter.com/wooorm/status/1431289978961764357. CJS users can use a dynamic People writing code for browsers-only often already have some experience with or existing setup for loading packages from npm, and alternatively all evergreen browsers support ESM as well, so they could use CDNs such as skypack, esm.sh, and the like. That means I don’t deal with bundling or compiling the code in my packages at all. And for little websites I use esbuild to make module/nomodule bundles. One example is double-metaphone here: https://github.com/words/double-metaphone. Glad to hear you got a setup working btw! |
looks like i managed to do something :D thanks @wooorm ! |
To make sure it works in safari
The text was updated successfully, but these errors were encountered: