Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
babel-plugin-relay
Advanced tools
Relay requires a Babel plugin to convert GraphQL tags to runtime artifacts.
A very simplified example of what this plugin is doing:
// It converts this code
const fragment = graphql`
fragment User_fragment on User {
name
}
`;
// To require generated ASTs for fragments and queries
const fragment = require('__generated__/User_fragment.graphql');
babel-plugin-relay
will discover the config if:
relay.config.json
, relay.config.js
file at the root of the
project (i.e. in the same folder as the package.json
file).package.json
file contains a "relay"
key.babel-plugin-relay
artifactDirectory
A specific directory to output all artifacts to. When
enabling this the babel plugin needs artifactDirectory
to be set as well.
[string]eagerEsModules
This option enables emitting ES modules artifacts.
[boolean][default: false]codegenCommand
The command to run to compile Relay files. [string]isDevVariableName
Name of the global variable for dev mode (e.g. __DEV__
).
[string]jsModuleFormat
Formatting style for generated files. commonjs
or haste
.
Default is commonjs
. [string]FAQs
A Babel Plugin for use with Relay applications.
We found that babel-plugin-relay demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.