JSPM

@roots/bud-react

6.3.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3343
  • Score
    100M100P100Q129420F
  • License MIT

React support for @roots/bud projects.

Package Exports

  • @roots/bud-react
  • @roots/bud-react/babel-refresh
  • @roots/bud-react/extension
  • @roots/bud-react/react-refresh
  • @roots/bud-react/react-refresh/extension
  • @roots/bud-react/react-refresh/index
  • @roots/bud-react/react-refresh/reducers
  • @roots/bud-react/swc-refresh
  • @roots/bud-react/typescript-refresh

Readme

bud.js

MIT License npm Follow Roots

@roots/bud-react

React support for @roots/bud projects.


Installation

Install @roots/bud-react to your project.

Yarn:

yarn add @roots/bud-react --dev

npm:

npm install @roots/bud-react --save-dev

Usage

React Refresh

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.

Configuring react-refresh

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 });

Compatibility

Babel

react-refresh is automatically enabled when using @roots/bud-babel. This is the integration that is supported out-of-the-box.

TypeScript

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.

SWC

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.

ESBuild

There isn't currently any support for esbuild mentioned in the documentation.

Contributing

Contributions are welcome from everyone.

We have contribution guidelines to help you get started.

License

@roots/bud-react is licensed under MIT.

Community

Keep track of development and community news.

Sponsors

Help support our open-source development efforts by becoming a patron.

KM Digital Carrot C21 Redwood Realty WordPress.com Pantheon