Move babel-plugin-react-compiler to devDependencies
- Dominant language
- TypeScript
- Stars
- 481
- Forks
- 108
- Avg merge
- 6d 8h
- Merged PRs (30d)
- 5
Description
`babel-plugin-react-compiler` is declared in `packages/graph-explorer/package.json` under `dependencies`, but it is build-time tooling. It ships into the runtime image as a result.
Nothing in `src/` imports it. It reaches the build through `vite.config.ts`, which calls `reactCompilerPreset()` from `@vitejs/plugin-react` and hands it to `@rolldown/plugin-babel`. The workspace root already declares it correctly in `devDependencies`.
The reason it ends up in the image is the `Dockerfile` sequence: `pnpm install --frozen-lockfile` (full), `pnpm build`, `pnpm clean:dep`, then `pnpm install --prod --frozen-lockfile --ignore-scripts`. The build runs against the full install, so moving the entry to `devDependencies` won't affect it — but the `--prod` install afterwards keeps anything in `dependencies`, so the plugin and its closure (about 3.7 MB) land in the shipped image for nothing.
## Work
Move `babel-plugin-react-compiler` from `dependencies` to `devDependencies` in `packages/graph-explorer/package.json`. Leave the root declaration alone.
## Acceptance
`pnpm build` still emits the compiler's memoization (the output should contain `react/compiler-runtime` imports with cache slots — a quick way to confirm the preset still ran), `pnpm checks` and `pnpm test` pass, the image builds, and `babel-plugin-react-compiler` is absent from the built image's `node_modules`.
> [!IMPORTANT]
> Internal only — this issue is maintained by the core team and is not accepting external contributions.
Contributor guide
Research direction
Edit packages/graph-explorer/package.json, moving babel-plugin-react-compiler while leaving the workspace root unchanged. Read vite.config.ts and the Dockerfile first, then run pnpm build, pnpm checks, pnpm test, and the image build. Done means compiler memoization remains in the build output and the plugin is absent from the shipped image's node_modules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- babel, react, typescript, vite
- Domain
- build-system, devops
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100