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 with jsc.transform.react.refresh
.
.swcrc:
{
"jsc": {
"experimental": {
"plugins": [
[
// enable prefresh specific transformation
"@swc/plugin-prefresh",
{
// the customizable preact name, default is `["preact", "preact/compat", "react"]`
"library": ["preact-like-framework"]
}
]
]
},
"parser": {
"jsx": true
},
"transform": {
"react": {
"development": true,
"refresh": true, // enable react refresh transformation
}
}
}
}
- f155bce: Update swc_core to v9
- c9e75ce: Bump crate versions
- 4574a70: Update swc_core to v8.0.1
- f3cea5f: Bump versions
- a73664c: Update swc_core to v6.0.2
- 4ad7f56: Update swc_core to v5
- ba13397: Update swc_core to v4
- 0508b6d: Update swc_core to v3
- cd5ad2a: Update swc_core to 1.0
- 20162c8: Update swc_core to v0.106.0
- 04548e2: Update swc_core to 0.103.x
- f8e5fd0: Update swc_core to 0.102.x
- 7d17e25: Update swc_core to v0.101.x
- 7391419: Update swc_core to v0.100.0
- 9c28afb: Update swc_core to 0.99.x (@swc/core 1.7.0)