Skip to content

Latest commit

 

History

History
 
 

plugin-react-refresh

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

@snowpack/plugin-react-refresh

Transforms JavaScript files containing React components automatically to enable React Fast Refresh. Connects to Snowpack's Hot Module Replacement (HMR) API.

npm install --save-dev @snowpack/plugin-react-refresh
// snowpack.config.json
{
  "plugins": ["@snowpack/plugin-react-refresh"]
}

In addition, you have to add react-refresh/babel as a plugin to your babel configuration:

// babel.config.json
{
  "env": {
    "development": {
      "plugins": [
        "react-refresh/babel"
      ]
    }
  }
}

Default Build Script

{
  "scripts": {"bundle:*": "@snowpack/plugin-react-refresh"}
}

Plugin Options

None