An esbuild plugin that transforms tagged GraphQL template literals for Relay by replacing them with imports to pre-compiled artifacts. Version 0.1.0, pre-release, with no fixed release cadence. Key differentiators: supports esbuild's fast builds, works with TypeScript and both CommonJS/ESM. Caveat: uses string replacement (no AST parsing), so it may process commented-out GraphQL literals.
npm install esbuild-plugin-relayNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure the relay plugin with esbuild, specifying artifact directory and language.
Ensure no commented-out GraphQL literals exist, or use a babel-based approach for AST-aware transforms.
Use module: 'commonjs' or module: 'esm' instead of language option.
Run relay-compiler before esbuild build, and ensure artifact directory matches option.
Run npm install -D esbuild-plugin-relay graphql esbuild
Ensure relay() plugin is added to esbuild plugins array and relay-compiler artifacts exist.
Use import relay from 'esbuild-plugin-relay' or const relay = require('esbuild-plugin-relay').default