react-refresh-webpack-plugin's main wiring snippet stops mid expression, and the registry calls it experimental
A Webpack plugin to enable "Fast Refresh" (also previously known as Hot Reloading) for React components.
At a glance
- What is it?
- A webpack plugin that makes Fast Refresh work for React, with three dev server integrations, a recommended and a minimum dependency table, and a required peer dependency you install by hand. Its package description labels it experimental in bold markup, while the README's own one-liner does not.
- Who is it for?
- This fits a webpack project on React that wants component state preserved across edits rather than a full page reload, and that is willing to wire two transforms rather than one. Three things to check before you adopt it.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 10 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- pmmmwh/react-refresh-webpack-plugin3,186 ★ · +0
| Repository | 2026-09-24 | 2026-11-25 |
|---|---|---|
| pmmmwh/react-refresh-webpack-plugin | 3.2k | 3.2k |
0 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The snippet that adds the plugin is cut off before it finishes
The README has several code blocks and one of them is incomplete in a way that matters.
The block is the main wiring example. It defines a flag from the environment, exports a module whose mode depends on it, sets up a rule matching JavaScript and TypeScript extensions while excluding installed packages, and points that rule at a loader with the Babel transform from the React team's package in its plugin list. Then it ends, mid-expression, on the line that adds this plugin to the webpack plugins array. There is no closing bracket, no filter call, no closing brace.
That last line is the only place in the document where the plugin itself is added to a configuration. Everything before it is the surrounding harness: the dev server, hot replacement, the loader, the transform. So the block that would tell you the exact shape of the option object, and whether it takes anything, is the one that stops.
What the surrounding prose does tell you is the constraint that applies to it. A note states that both the Babel transform and this plugin must be enabled only in development mode. Every snippet in the document expresses the same idea the same way, by putting a development-only value in an array and filtering the falsy entry out, so the pattern to follow is consistent even where the code is missing.
Everything else in that section, the hot replacement setup and the loader rule, is complete and usable.
Three dev servers, one recommended, and the same guard in every snippet
The README covers three development server integrations, and treats them very differently.
The first is the recommended path, and it is recommended on the grounds of coverage and ownership rather than preference: the loader it uses covers the most cases and is officially supported by the React team. Its snippet turns hot replacement on in the dev server options:
const isDevelopment = process.env.NODE_ENV !== 'production';
module.exports = {
mode: isDevelopment ? 'development' : 'production',
devServer: {
hot: true,
},
};The other two sit inside collapsed sections. One is for a middleware-based setup and constructs the hot module replacement plugin from webpack itself. The other is for a serve plugin and constructs that plugin instead. Both do exactly what the first does by a different route, and both carry the same development guard.
That guard is the one piece of behaviour every example shares. Each snippet computes a development flag from an environment variable, uses it to choose the webpack mode, and then filters the conditional plugin out of the array so it never appears in a production build. The plugin itself is never toggled that way in the visible text, because the array it goes into is inside the truncated block.
So the document is consistent about the rule that matters and incomplete about the line that applies it. A reader has the pattern from three other snippets and the gap from the one that would have shown it.
Three releases in fourteen months, and the package index says experimental
Two documents describe this project and they do not use the same words for it.
The README's opening line is neutral: a webpack plugin to enable Fast Refresh for React components. The package metadata's description adds a word, and adds it in bold markup, calling the plugin experimental.
That word is doing real work in a registry context, where a description is what an installing developer reads before they click. And it is written with formatting markers inside a field that registries render as plain text, so the markers appear literally rather than emphasising anything.
Then there is the version line. The README carries a note saying the authors are hoping to land a version 1 release soon and asking for issue reports to help. The recent releases are three in the zero series across fourteen months, ending with the version currently in the manifest.
So the project has been promising a 1.0 across three releases, and the registry has been calling it experimental throughout. Neither statement is a promise about the other.
For an adopter the practical reading is that the option interface can change without a major version bump, and the project's own metadata says so.
The two version tables disagree about React, and type-fest's ladder starts below the plugin's own floor
The prerequisites section publishes two tables, one recommended and one minimum, and the interesting differences are in the gaps between them.
For React and its DOM package the recommendation is a later floor than the minimum, by four minor versions. Both accept a wide range of later majors, so the tables are telling you the same story at two levels of caution.
For Node the picture is different. The minimum and the recommendation share the same floor, and the recommendation then enumerates three majors, ending at 22. That list is maintained by hand and there is no stated ceiling, which is a reasonable way to write it and a list that has to be revisited when a new major ships.
The sharper inconsistency is in the TypeScript section. To use a typed webpack config you have to install a separate types package as a development dependency, because the plugin's exported types depend on it. The note that follows maps that package's majors to Node floors, and the ladder it gives starts at Node 12.20, then 14.16, then 16, with an older line for anything below.
So the document explains how to choose a dependency by Node version, using versions six releases below the Node version the plugin itself requires. The mapping concerns the dependency and may be right; it is still the first place a reader with an old Node meets a number that reads as an endorsement.
One requirement is absolute, though. The README says older peer versions cannot be made compatible, because the code needed to orchestrate Fast Refresh does not exist in them. That is not a warning, it is an upgrade notice.
Six shipped directories the README never names, and one published path with no directory
The package ships eight directories, and six of them have a runtime job the README does not describe.
The documented surface is the loader and the plugin itself. The unpublished explanation covers the client half, which has to run in the page for a refresh to do anything, and the error overlay. The dev server socket directory is what carries messages between the two. The options directory holds the option schema. And the main field points at a compiled library directory rather than at the package root.
Six directories that a reader of the README cannot account for, in a package whose whole purpose is a specific integration.
The published file list has one entry with no matching directory. It names a universal module bundle directory alongside the client, loader, options, overlay, socket and type directories, and there is no such directory at the root of the repository. Whether it is generated and absent from the tree, or left over from an earlier build, is nowhere recorded.
The type declarations are the one part that is explained by the build rather than the prose. A script deletes the types directory and another recompiles it, and the package's types field points inside the result. So the shipped declarations are generated into the working tree rather than committed, which is a deliberate arrangement and one that means the published types and the repository's tree do not look the same.
The repository is pinned to one package manager while the install docs offer three
Three facts about tooling that do not line up.
The manifest pins the package manager to version 1 of the yarn classic line, with an integrity hash attached, and a lock file in that format sits at the root. The test scripts are built around yarn's own linking commands, unlinking them again afterwards. And the project's own continuous integration script invokes yarn directly.
The install instructions, meanwhile, offer three package managers as equals, one command each for npm, yarn and pnpm, for the plugin and its peer dependency. That is the right thing to document for a consumer.
The gap is the testing mechanism, which is the part a contributor has to reproduce. The test entry point runs a pre step, the real run, and a post step in sequence, and the pre and post steps are the link and unlink commands. So the suite tests the package the way yarn links it, on yarn 1, and a contributor on npm or pnpm is reproducing something slightly different from what continuous integration runs.
Two details in that machinery are worth crediting. The test runner invokes node with a flag enabling its module support, which is what lets the suite use modern module syntax. And a dedicated script runs the whole suite against a pinned major version of the dev server by setting an environment variable, so the integration is verified against more than one generation of the server rather than only the newest.
Seven example projects, including one transform the prose never documents
The examples directory is the best documentation in this repository, and it covers more than the README does.
Seven projects are there. Three are dev server variants, matching the three integrations in the prose. Two use Babel with different source languages, one with Flow and one with TypeScript. And two are TypeScript projects wired through different compilers: one through the TypeScript compiler itself and one through a Rust-based transformer.
That last one is the gap. The README's TypeScript section documents exactly two routes, the Babel one it recommends and the loader-based one it marks as an un-official community integration. Neither is the Rust-based transformer, yet there is a full example project for it. So a reader working in that setup has working code in the repository and no explanation of it in the prose.
The custom renderer section is the other unusual passage. For components rendered by something other than React's own renderer, three named renderers given as examples, the advice is to depend on a recent version of the reconciler, with a recommendation and a looser acceptable range. And then: if the renderer is not compatible, file them an issue. A plugin's documentation asking readers to open issues on third-party projects, by name, is a piece of ecosystem coordination rather than documentation, and it tells you the support boundary is wider than the package's own types.
The TypeScript loader path also carries an explicit warning that it is an un-official integration maintained by the community, which is the honest label for it.
Editorial conclusion
This fits a webpack project on React that wants component state preserved across edits rather than a full page reload, and that is willing to wire two transforms rather than one. Three things to check before you adopt it. The plugin has never left the zero series, so treat the API as movable, and note that the package index describes it as experimental while the README does not. The integration snippet that actually adds the plugin is truncated in the README, so plan to read the example projects rather than the prose. And the minimum dependency versions are not negotiable: the README says outright that older peer versions cannot be made compatible, so an older React or webpack is an upgrade rather than a workaround.
Frequently asked questions
Does anyone still use webpack?
That is not a question this repository answers, and it is not the right place to look. What it documents is a webpack plugin that enables Fast Refresh for React, with three development server integrations, a minimum of webpack 5.2.0, and support for a range of recent React and Node versions.
Does React use webpack or Vite?
The repository does not compare bundlers. Its scope is a webpack plugin, and its examples cover three webpack development servers with Babel, the TypeScript compiler and a Rust-based transformer as the transform step.
How do I refresh a React page?
The mechanism this project documents is preserving component state rather than reloading the page: a Babel transform from the React team's package plus this webpack plugin, both enabled only in development mode and wired through a loader, on top of hot module replacement in the dev server. The README also states that older peer versions cannot be made compatible.
What is the purpose of webpack?
Not this repository's subject. It documents one plugin's integration requirements, its three supported development server setups, the peer dependencies you have to install yourself, and the type declarations you have to build if you want a typed webpack config.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/pmmmwh-react-refresh-webpack-plugin)Star history chart for your README
[](https://hysenlabs.com/projects/pmmmwh-react-refresh-webpack-plugin)Was this useful?