How to use loadFilesSync in vercel #4209
-
|
Hello, I am curious if anyone has any tips on how to use I am using the following code It works fine locally but breaks in vercel deployments due to the directory structure vercel uses. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
My solution was to not use I am following the solution in this issue: piglovesyou/graphql-let#534 (comment) Essentially rather than dealing with I configured Here is how I generate my schema now compared to using |
Beta Was this translation helpful? Give feedback.
-
|
Tell Vercel to include .graphql files Create vercel.json: { |
Beta Was this translation helpful? Give feedback.
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
loadFilesSyncand figuring out vercels build system, I am using a webpack loader to import the.gqlfiles into the build.I configured
next.config.jslike so: