8.0.0 • Published 2 months ago

@swc/plugin-prefresh v8.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

@swc/plugin-prefresh

The SWC implementation of the prefresh babel plugin.

Usage

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
      }
    }
  }
}

${CHANGELOG}

7.0.4

3 months ago

7.0.3

4 months ago

7.0.2

4 months ago

7.0.1

4 months ago

8.0.0

2 months ago

7.0.0

6 months ago

6.1.0

7 months ago

6.2.0

6 months ago

6.3.2

6 months ago

5.0.2

8 months ago

5.0.0

9 months ago

6.0.1

8 months ago

6.0.3

7 months ago

6.0.2

8 months ago

6.0.4

7 months ago

4.0.0

9 months ago

3.0.3

10 months ago

3.0.2

11 months ago

3.0.1

11 months ago

3.0.0

12 months ago

2.0.10

12 months ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.7

1 year ago