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"
]
}
}
}
{
"scripts": {"bundle:*": "@snowpack/plugin-react-refresh"}
}
None