Relay plugin for esbuild based on https://www.npmjs.com/package/babel-plugin-relay
npm install esbuild-relay-pluginAn esbuild plugin to transform tagged GraphQL template literals for Relay. Heavily inspired by babel-plugin-relay.
Features
* Replaces graphql tagged template literals with imports to the artifacts generated by relay-compiler
* Supports CommonJS and ESM module formats
Caveat
* This plugin uses string replacements and does not parse the source code. This means it will try to compile GraphQL literals even if they are commented out. If that does not fit your workflow, you'll need to use ESBuild + babel + babel-plugin-relay.
bash
npm install -D esbuild-relay-plugin
`$3
`bash
yarn add -D esbuild-relay-plugin
`Usage
`typescript
import esbuild from "esbuild"
import { EsbuildRelayPlugin } from "esbuild-relay-plugin"esbuild.build({
// ...other options,
plugins: [
new EsbuildRelayPlugin(),
]
})
``