8.0.0 • Published 20 days ago

@swc/plugin-prefresh v8.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
20 days 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

2 months ago

7.0.3

3 months ago

7.0.2

3 months ago

7.0.1

3 months ago

8.0.0

20 days ago

7.0.0

4 months ago

6.1.0

5 months ago

6.2.0

5 months ago

6.3.2

4 months ago

5.0.2

7 months ago

5.0.0

8 months ago

6.0.1

7 months ago

6.0.3

6 months ago

6.0.2

7 months ago

6.0.4

5 months ago

4.0.0

8 months ago

3.0.3

9 months ago

3.0.2

9 months ago

3.0.1

10 months ago

3.0.0

10 months ago

2.0.10

11 months ago

2.0.9

11 months ago

2.0.8

12 months ago

2.0.7

12 months ago