-
-
Notifications
You must be signed in to change notification settings - Fork 386
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 SWC Plugin #529
Comments
Hey @heygrady 👋, |
Cross linking: kentcdodds/babel-plugin-macros#144 |
It looks great, any PR is welcome! |
Look like here is the documentation - https://swc-project.github.io/docs/usage-plugin |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Did anyone have a chance to look at this yet?
The plugin api's might be deprecated in the next versions of swc.
With that said, I believe the loadable plugin would be similar to the dynamic plugin from next.js. |
We're in the same boat over here. I was looking at what would be needed to do this, but, I don't have enough knowledge with AST or the time available (unless I get granted time during work) to do this. This is (AFAIK) the only thing that's stopping us from migrating over to SWC as well. |
same here - updated links to Next.js implementation https://github.com/vercel/next.js/blob/canary/packages/next-swc/crates/core/src/next_dynamic.rs |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Perhaps a workaround could be to use babel only on the files containing @lodable() statements? For example by naming them something like |
That is a good option and actually can lead to a better visibility over bundle structure. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
And #909 |
https://swc-project.github.io/docs/usage-plugin
Proposal: create an
@loadable/swc-plugin
that is similar to@loadable/babel-plugin
SWC is increasing in popularity. It is aiming to be a drop-in replacement for babel with some significant speed improvements. It already has a webpack loader.
There is some early interest in how it might integrate with create-react-app (facebook/create-react-app#8060). Looking at which babel plugins create-react-app uses it seems like most of those things are supported by swc (with only a few exceptions).
Looking at my own projects, I see only a few things that are blocking me from switching to SWC.
babel-plugin-macros
(which I could live without)@loadable/babel-plugin
Generally everything else babel does for me is handled by swc preset-env (or isn't particularly vital to my projects).
The text was updated successfully, but these errors were encountered: