You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
react-compiler-webpack has already declares babel-plugin-react-compiler as its peer dependency and it will be installed automatically when you install react-compiler-webpack with most package managers. But you can also explictly specify the version you want to use by manually install babel-plugin-react-compiler in your project:
// webpack.config.js / rspack.config.js// You can leverage your IDE's Intellisense (autocompletion, type check, etc.) with the helper function `defineReactCompilerLoaderOption`:const{ defineReactCompilerLoaderOption, reactCompilerLoader }=require('react-compiler-webpack');module.exports={module: {rules: [{test: /\.[mc]?[jt]sx?$/i,exclude: /node_modules/,use: [// babel-loader, swc-loader, esbuild-loader, or anything you like to transpile JSX should go here.// If you are using rspack, the rspack's buiilt-in react transformation is sufficient.// { loader: 'swc-loader' },//// Now add reactCompilerLoader{loader: reactCompilerLoader,options: defineReactCompilerLoaderOption({// React Compiler options goes here})}]}]}};