Skip to content

How to use loadFilesSync in vercel #4209

Discussion options

You must be logged in to vote

My solution was to not use import { loadFilesSync } from '@graphql-tools/load-files'

I am following the solution in this issue: piglovesyou/graphql-let#534 (comment)

Essentially rather than dealing with loadFilesSync and figuring out vercels build system, I am using a webpack loader to import the .gql files into the build.

I configured next.config.js like so:

/** @type {import('next').NextConfig} */
module.exports = {
  reactStrictMode: true,
  images: {
    domains: ['zah-dutchie.imgix.net', 'images.dutchie.com'],
  },
  webpack: (config) => {
    config.module.rules.push({
      test: /\.gql$/,
      exclude: /node_modules/,
      loader: '@graphql-tools/webpack-loader',
    })

    ret…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChrisLFieldsII
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant