{"id":13677908,"url":"https://github.com/SukkaW/react-compiler-webpack","last_synced_at":"2025-04-29T12:32:17.177Z","repository":{"id":240000576,"uuid":"801386025","full_name":"SukkaW/react-compiler-webpack","owner":"SukkaW","description":"The webpack/rspack loader for React Compiler","archived":false,"fork":false,"pushed_at":"2024-10-29T19:00:30.000Z","size":535,"stargazers_count":33,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T11:47:05.894Z","etag":null,"topics":["react","react-compiler","rspack","rspack-loader","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SukkaW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-16T06:10:59.000Z","updated_at":"2024-11-08T11:45:51.000Z","dependencies_parsed_at":"2024-05-16T08:29:19.833Z","dependency_job_id":"1c8f3937-1ecc-473c-b9cf-8ba34a4679ce","html_url":"https://github.com/SukkaW/react-compiler-webpack","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"759141d6dcaa5c7d5688311639e90c3cf8ece9f6"},"previous_names":["sukkaw/react-compiler-webpack"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Freact-compiler-webpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Freact-compiler-webpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Freact-compiler-webpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Freact-compiler-webpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SukkaW","download_url":"https://codeload.github.com/SukkaW/react-compiler-webpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173288,"owners_count":17268088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","react-compiler","rspack","rspack-loader","webpack","webpack-loader"],"created_at":"2024-08-02T13:00:48.412Z","updated_at":"2025-04-29T12:32:17.148Z","avatar_url":"https://github.com/SukkaW.png","language":"TypeScript","readme":"# React Compiler for webpack\n\nA webpack loader, a [rspack](https://www.rspack.dev/) loader that brings [the official React Compiler](https://react.dev/learn/react-compiler) to your project.\n\n## Installation\n\n```bash\n# npm\nnpm i -D react-compiler-webpack\n# yarn\nyarn add -D react-compiler-webpack\n# pnpm\npnpm add -D react-compiler-webpack\n```\n\n`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 like by manually install `babel-plugin-react-compiler` in your project:\n\n```bash\n# npm\nnpm i -D babel-plugin-react-compiler\n# yarn\nyarn add -D babel-plugin-react-compiler\n# pnpm\npnpm add -D babel-plugin-react-compiler\n```\n\n## Usage\n\n### webpack/rspack\n\n```js\n// webpack.config.js / rspack.config.js\n\n// You can leverage your IDE's Intellisense (autocompletion, type check, etc.) with the helper function `defineReactCompilerLoaderOption`:\nconst { defineReactCompilerLoaderOption, reactCompilerLoader } = require('react-compiler-webpack');\n\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.[mc]?[jt]sx?$/i,\n        exclude: /node_modules/,\n        use: [\n          // babel-loader, swc-loader, esbuild-loader, or anything you like to transpile JSX should go here.\n          // If you are using rspack, the rspack's buiilt-in react transformation is sufficient.\n          // { loader: 'swc-loader' },\n          // Now add reactCompilerLoader\n          {\n            loader: reactCompilerLoader,\n            options: defineReactCompilerLoaderOption({\n              // React Compiler options goes here\n            })\n          }\n        ]\n      }\n    ]\n  }\n};\n```\n\n### Next.js\n\nNext.js has already integrated the React Compiler and can be enabled with the following configuration:\n\n```js\n// next.config.js\nmodule.exports = {\n  experimental: {\n    reactCompiler: true // or React Compiler options\n  }\n}\n```\n\nUsing Next.js built-in React Compiler integration is highly recommended. But if you insist on going with `react-compiler-webpack`, you can follow use the provided Next.js plugin:\n\n```js\n// next.config.js\nconst { withReactCompiler } = require('react-compiler-webpack');\n\nmodule.exports = withReactCompiler({\n  // React Compiler options goes here\n})({\n  // Next.js config goes here\n});\n```\n\n## Author\n\n**react-compiler-webpack** © [Sukka](https://github.com/SukkaW), Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by Sukka with help from contributors ([list](https://github.com/SukkaW/react-compiler-webpack/graphs/contributors)).\n\n\u003e [Personal Website](https://skk.moe) · [Blog](https://blog.skk.moe) · GitHub [@SukkaW](https://github.com/SukkaW) · Telegram Channel [@SukkaChannel](https://t.me/SukkaChannel) · Twitter [@isukkaw](https://twitter.com/isukkaw) · Mastodon [@sukka@acg.mn](https://acg.mn/@sukka) · Keybase [@sukka](https://keybase.io/sukka)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/sponsors/SukkaW/\"\u003e\n    \u003cimg src=\"https://sponsor.cdn.skk.moe/sponsors.svg\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/SukkaW/"],"categories":["TypeScript","Plugins"],"sub_categories":["Rspack Loaders"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSukkaW%2Freact-compiler-webpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSukkaW%2Freact-compiler-webpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSukkaW%2Freact-compiler-webpack/lists"}