2.5.0 • Published 3 years ago
@snowpack/plugin-react-refresh v2.5.0
@snowpack/plugin-react-refresh
Transforms JavaScript files containing React components automatically to enable React Fast Refresh via Snowpack's HMR API.
npm install --save-dev @snowpack/plugin-react-refresh
Setup
// snowpack.config.json
{
"plugins": ["@snowpack/plugin-react-refresh", {/* options: see below */}]
}
Plugin Options
Name | Type | Description |
---|---|---|
babel | boolean or object | By default, this plugin uses Babel to add Fast-Refresh code to eligible JS files. If you want to configure & run this yourself, set "babel": false" . Alternatively, you can pass a custom Babel configuration object to enhance or override the defaults. Most users won't need this. |
How it Works
This plugin will automatically inject HMR event handlers into any file containing a React component.
In most applications, you'll still want some top-level import.meta.hot
handling code in your application for any non-React file updates. In our Create Snowpack App templates, this would be the HMR handling snippet found in src/index.js
.
2.5.0
3 years ago
2.4.2
3 years ago
2.4.1
3 years ago
2.4.0
3 years ago
2.3.9
3 years ago
2.3.8
3 years ago
2.3.7
3 years ago
2.3.6
3 years ago
2.3.5
4 years ago
2.3.4
4 years ago
2.3.3
4 years ago
2.3.2
4 years ago
2.3.1
4 years ago
2.3.0
4 years ago
2.2.0
4 years ago
2.1.0
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
1.3.0
4 years ago
1.1.5
4 years ago
1.0.0
4 years ago
0.8.0
4 years ago
0.7.0
4 years ago