npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@witejs/plugin-react-refresh

v1.3.6

Published

Provides [React Refresh](https://www.npmjs.com/package/react-refresh) support for Wite.

Readme

@witejs/plugin-react-refresh

Provides React Refresh support for Wite.

// wite.config.js
import reactRefresh from '@witejs/plugin-react-refresh'

export default {
  plugins: [reactRefresh()]
}

Specifying Additional Parser Plugins

If you are using ES syntax that are still in proposal status (e.g. class properties), you can selectively enable them via the parserPlugins option:

export default {
  plugins: [
    reactRefresh({
      parserPlugins: ['classProperties', 'classPrivateProperties']
    })
  ]
}

Full list of Babel parser plugins.

Specifying files to include or exclude from refreshing

By default, @wite/plugin-react-refresh will process files ending with .js, .jsx, .ts, and .tsx, and excludes all files in node_modules.

In some situations you may not want a file to act as an HMR boundary, instead preferring that the changes propagate higher in the stack before being handled. In these cases, you can provide an include and/or exclude option, which can be regex or a picomatch pattern, or array of either. Files must match include and not exclude to be processed. Note, when using either include, or exclude, the defaults will not be merged in, so re-apply them if necessary.

export default {
  plugins: [
    reactRefresh({
      // Exclude storybook stories and node_modules
      exclude: [/\.stories\.(t|j)sx?$/, /node_modules/],
      // Only .tsx files
      include: '**/*.tsx'
    })
  ]
}

Notes

  • If using TSX, any TS-supported syntax will already be transpiled away so you won't need to specify them here.

  • This option only enables the plugin to parse these syntax - it does not perform any transpilation since this plugin is dev-only.

  • If you wish to transpile the syntax for production, you will need to configure the transform separately using @rollup/plugin-babel as a build-only plugin.

Middleware Mode Notes

When Wite is launched in Middleware Mode, you need to make sure your entry index.html file is transformed with WiteDevServer.transformIndexHtml. Otherwise, you may get an error prompting Uncaught Error: @witejs/plugin-react-refresh can't detect preamble. Something is wrong.

To mitigate this issue, you can explicitly transform your index.html like this when configuring your express server:

app.get('/', async (req, res, next) => {
  try {
    let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')
    html = await witeServer.transformIndexHtml(req.url, html)
    res.send(html)
  } catch (e) {
    return next(e)
  }
})