What is @parcel/transformer-react-refresh-wrap?
@parcel/transformer-react-refresh-wrap is a Parcel transformer plugin that enables React Fast Refresh, a feature that allows you to get near-instant feedback for changes in your React components without losing component state.
Enable React Fast Refresh
This code snippet demonstrates how to enable React Fast Refresh in a Parcel bundler configuration. By adding the @parcel/transformer-react-refresh-wrap as an asset type for JavaScript files, you can leverage the fast refresh capabilities in your React project.
module.exports = function (bundler) {
bundler.addAssetType('js', require.resolve('@parcel/transformer-react-refresh-wrap'));
};