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

ReactRefreshRspackPlugin.loader property

The loader for react refresh.

Signature:

static loader: string;

Remarks

Please note that the runtime of react should be ignored. See the example below:

Example

// rspack.config.js
import { ReactRefreshRspackPlugin } from '@lynx-js/react-refresh-webpack-plugin'
import { ReactWebpackPlugin } from '@lynx-js/react-webpack-plugin'

export default {
  module: {
    rules: [
      {
        issueLayer: ReactWebpackPlugin.LAYERS.BACKGROUND,
        test: /\.[jt]sx?$/,
        exclude: [
          /node_modules/,
          /@lynx-js\/react/,
          ReactRefreshRspackPlugin.loader,
        ],
        use: [ReactRefreshRspackPlugin.loader],
      },
    ],
  },
  plugins: [new ReactRefreshRspackPlugin()],
}