Automatically run the Relay Compiler from within the Webpack build process, eliminating manual compilation steps. Version 9.1.0 supports relay-compiler >=8.0.0, webpack >=3.0.0, and graphql >=14.0.0. Regularly updated with each Relay major release. Key differentiators: hooks (beforeWrite, afterWrite) for custom tooling, TypeScript plugin support via relay-compiler-language-typescript, and webpack 5 compatibility. Lighter-weight alternative to Babel macro-based solutions.
npm install relay-compiler-webpack-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal webpack config to auto-run relay-compiler with custom scalar support.
Use yarn —flat or npm dedupe to enforce a single graphql version matching relay-compiler's peer dep.
Upgrade relay-compiler to >=6.0.0. See upgrade guide for breaking changes.
Update relay-compiler to >=7.0.0 and upgrade your GraphQL queries/fragments if needed.
Upgrade to >=8.0.2. In v8.0.0/v8.0.1, set customScalars via relay-compiler's own config if possible.
Add graphql (>=14.0.0) to your project's dependencies.
Install a single version of graphql that satisfies both relay-compiler and this plugin's peer dep (>=14).
Ensure the plugin is added to the plugins array, not called inside a function.
Install relay-compiler matching plugin's peer dependency range (>=8.0.0 for v9.x).