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

Add support for https://github.com/privatenumber/esbuild-loader like SWC #49

Closed
justin808 opened this issue Feb 4, 2022 · 3 comments
Closed

Comments

@justin808
Copy link
Member

Check out what we did for SWC:

#29

And create a PR here, like what we did for SWC:
https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh

@tomdracz
Copy link
Collaborator

tomdracz commented Feb 5, 2022

Just some notes for anyone looking to pick this up!

Actual new rule setup should be super straightforward - SWC PR linked can be used as good basis on how to determine if loader is available, how to have rule as a function so current filename can be processed etc Easy peasy!

While at it, it could be good to see if we can also swap out Terser plugin for esbuild minifier, which should be faster. More info in article at https://blog.logrocket.com/webpack-or-esbuild-why-not-both/

HOWEVER, unlike Babel & SWC that mostly have feature parity, there are few gotchas with esbuild like:

This is non-exhaustive list, but it does show that using esbuild might not be suitable for everyone. Projects that don't use JSX, don't need to support older browsers might get a better experience here.

Performance boost could be worth it though, so it will be nice to offer this as an option!

@tomdracz
Copy link
Collaborator

tomdracz commented Feb 7, 2022

Looks like I've linked to the wrong issue in the PR, d'oh! We can close this one.

@justin808
Copy link
Member Author

Fixed in #53

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

No branches or pull requests

2 participants