Max RozenTwitter

How do you make relay-compiler run automatically?

Making relay-compiler run automatically

Relay can be annoying to work with as relay-compiler needs to run every time you change your GraphQL schema, or your resolvers.

With relay-compiler-webpack-plugin that’s no longer the case - webpack can run it for you!

Here’s how you use it:

const RelayCompilerWebpackPlugin = require('relay-compiler-webpack-plugin');
// rest of your config
new RelayCompilerWebpackPlugin({
    schema: 'schema.graphql',
    src: 'src/',
    extensions: ['js', 'jsx', 'ts', 'tsx'],
    artifactDirectory: 'src/__generated__',

Get The Newsletter!

    No spam, ever.

    Unsubscribe at any time.


    0 ❤️
    0 💬
    No further replies found. Tweet about this post and it will show up here!

    © 2020 Max Rozen. All rights reserved.