detrohutt / react-app-rewire-inline-import-graphql-ast

Add the inline-import-graphql-ast Babel plugin to your create-react-app app via react-app-rewired
MIT License
17 stars 2 forks source link

gql module not found when buidling #11

Open DavidHe1127 opened 5 years ago

DavidHe1127 commented 5 years ago

While react-app-rewired start works but react-app-rewired build complains about gql modules.

Any idea?

DavidHe1127 commented 5 years ago

Ive found it's actually because I am not setting NODE_PATH whose value is assigned to nodePath in the library.

I think it should parameterise nodePath rather than relying on env var. Note, jsconfig.json is preferred way of setting the path in the recent versions of react-script.

Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json

If you think it's a proposed solution I can open a PR for this.