Home > @lynx-js/react-refresh-webpack-plugin > ReactRefreshRspackPlugin

ReactRefreshRspackPlugin class

ReactRefreshRspackPlugin allows using fast refresh in ReactLynx.

Signature:

export declare class ReactRefreshRspackPlugin 

Example

// rspack.config.js
import { ReactRefreshRspackPlugin } from '@lynx-js/react-refresh-webpack-plugin'
export default {
  module: {
    rules: [
      {
        test: /\.[jt]sx?$/,
        exclude: [
          /node_modules/,
          /@lynx-js/,
          /react-refresh/,
          /compiler-nodiff-runtime3/,
          ReactRefreshRspackPlugin.loader,
        ],
        use: [ReactRefreshRspackPlugin.loader],
      },
    ],
  },
  plugins: [new ReactRefreshRspackPlugin()],
}

Constructors

ConstructorModifiersDescription
(constructor)(options)Constructs a new instance of the ReactRefreshRspackPlugin class

Properties

PropertyModifiersTypeDescription
loaderstaticstringThe loader for react refresh.

Methods

MethodModifiersDescription
apply(compiler)The entry point of a rspack plugin.