【发布时间】:2021-12-15 10:22:21
【问题描述】:
在relay docs 中,他们会提示您为中继编译器使用--artifactDirectory 选项。这会导致所有生成的文件都放在一个目录中,这对我来说听起来是个好主意!然而,使用这个选项会导致一堆这样的错误:
Failed to compile
./src/path/to/component/Component.tsx
Module not found: Can't resolve './__generated__/Component_field.graphql' in '/Users/me/path/to/project/src/path/to/component'
如何在create-react-app 中使用relay-compiler 的--artifactDirectory 选项?
【问题讨论】: