Gathering detailed insights and metrics for relay-compiler-webpack-plugin
Gathering detailed insights and metrics for relay-compiler-webpack-plugin
Gathering detailed insights and metrics for relay-compiler-webpack-plugin
Gathering detailed insights and metrics for relay-compiler-webpack-plugin
@dhau/relay-compiler-webpack-plugin
Automatically run the Relay Compiler from Webpack
@procensus/relay-compiler-webpack-plugin
Automatically run the Relay Compiler from Webpack
@ch1ffa/relay-compiler-webpack-plugin
Webpack pluging for running relay-compiler in webpack dev mode
@davidwu226/relay-compiler-webpack-plugin
Automatically run the Relay Compiler from Webpack
Automatically run the Relay Compiler from Webpack
npm install relay-compiler-webpack-plugin
Typescript
Module System
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
BSD-3-Clause License
65 Stars
256 Commits
35 Forks
3 Watchers
15 Branches
28 Contributors
Updated on Aug 25, 2024
Latest Version
9.1.0
Package Id
relay-compiler-webpack-plugin@9.1.0
Unpacked Size
20.93 kB
Size
6.74 kB
File Count
12
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
34
Are you running Relay Modern? Are you annoyed with constantly running the relay-compiler
to generate code, especially
if you're already running Webpack?
Well be annoyed no more! Simply install this plugin to automatically hook into Webpack's build process to generate these files for you.
1 yarn add --dev relay-compiler-webpack-plugin graphql 2 # Or if you're using npm 3 npm install --save-dev relay-compiler-webpack-plugin graphql
1// const RelayCompilerLanguageTypescript = require('relay-compiler-language-typescript').default 2const RelayCompilerWebpackPlugin = require('relay-compiler-webpack-plugin') 3const path = require('path') 4 5module.exports = { 6 // ... Your existing Webpack configuration 7 plugins: [ 8 // ... 9 new RelayCompilerWebpackPlugin({ 10 // languagePlugin: RelayCompilerLanguageTypescript, 11 schema: path.resolve(__dirname, './relative/path/to/schema.graphql'), // or schema.json 12 src: path.resolve(__dirname, './relative/path/to/source/files'), 13 }) 14 ] 15 // ... 16}
Note: TypeScript projects also needs to add the TypeScript language plugin as shown in the commented out lines in the above snippet.
If there are multiple versions of GraphQL in your dependency tree it will cause schema validation errors. To get around this, ensure you have the same graphql version as your relay-compiler version depends on. To assist this you can install dependencies as flat which ensures only one version of each dependency.
relay-compiler-webpack-plugin
exposes a few tapable hooks, for plugins or tooling to use.
beforeWrite
called before the plugin starts to compile queriesafterWrite(compileResult)
: called after writing is complete1class MyPlugin { 2 apply (compiler) { 3 compiler.hooks.compilation.tap('MyPlugin', async (compilation) => { 4 RelayCompilerWebpackPlugin.getHooks(compilation).afterWrite.tapPromise( 5 'MyPlugin', // <-- Set a meaningful name for stacktraces 6 async (compileResult) => { 7 if (compileResult === 'HAS_CHANGES') { 8 await doSomething() 9 } 10 } 11 ) 12 }) 13 } 14}
To see an example of its usage within a project, see relay-compiler-webpack-plugin-example.
Running tests:
1yarn test
Running tests with coverage:
1yarn test:coverage
Relay Compiler Webpack Plugin may be redistributed according to the BSD 3-Clause License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/18 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
46 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More