React support for @roots/bud projects.
Install @roots/bud-react to your project.
Yarn:
yarn add @roots/bud-react --dev
npm:
npm install @roots/bud-react --save-dev
This extension enables react-refresh in development. It uses @pmmmwh/react-refresh-webpack-plugin.
For usage guidance, consult the react-refresh-webpack-plugin API documentation.
To enable react-refresh:
bud.react.refresh.enable();
To disable react-refresh:
bud.react.refresh.disable();
Any @pmmmwh/react-refresh-webpack-plugin options can can be passed to bud.react.refresh.configure
:
bud.react.refresh.configure({ forceEnable: true });
react-refresh is automatically enabled when using @roots/bud-babel. This is the integration that is supported out-of-the-box.
react-refresh is automatically enabled when using @roots/bud-typescript.
If you are using babel
then react-refresh will be handled using the standard babel plugin.
If you are not then the react-refresh-typescript
tsc plugin will be used instead.
react-refresh is automatically enabled when using @roots/bud-swc.
If you are using a custom .swcrc
file you will need to supply your own configuration.
There isn't currently any support for esbuild mentioned in the documentation.
Contributions are welcome from everyone.
We have contribution guidelines to help you get started.
@roots/bud-react is licensed under MIT.
Keep track of development and community news.
- Join us on Roots Slack by becoming a GitHub sponsor
- Participate on the Roots Discourse
- Follow @rootswp on Twitter
- Read and subscribe to the Roots Blog
- Subscribe to the Roots Newsletter
bud.js is an open source project and completely free to use.
However, the amount of effort needed to maintain and develop new features and projects within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider sponsoring Roots.