-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat(prefresh): Add @swc/plugin-prefresh
#326
Conversation
|
@swc/plugin-prefresh
@swc/plugin-prefresh
Co-authored-by: Donny/강동윤 <[email protected]>
Co-authored-by: Donny/강동윤 <[email protected]>
Co-authored-by: Donny/강동윤 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Add
@swc/plugin-prefresh
, which is the SWC implementation of the prefresh babel plugin.Prefresh babel plugin is a forked equivalent of the react-refresh babel plugin difference being that we need a way to memoize createContext between HMR.
And SWC has built-in React Refresh transformation, therefore, this plugin only implements the
createContext
processing part and need to be used withjsc.transform.react.refresh
.For example: