This is the dev preview website. Check out the document at lynxjs.org

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

Constructor

Modifiers

Description

(constructor)(options)

Constructs a new instance of the ReactRefreshRspackPlugin class

Properties

Property

Modifiers

Type

Description

loader

static

string

The loader for react refresh.

Methods

Method

Modifiers

Description

apply(compiler)

The entry point of a rspack plugin.