Closed GiancarlosIO closed 2 years ago
I have solved this by using the babel-plugin-module-resolver
and transforming the library path from absolute to relative:
// babel.config.js
plugins: [
[
'module-resolver',
{
root: ['./src'],
alias: {
'@': './src',
// needed to compile graphql files because babel-plugin-graphql-import doesn't support imports from node_modules.
// related https://github.com/detrohutt/babel-plugin-import-graphql/issues/79
'@my-local-lib/web': '../web',
'@my-remote-lib/web': './node_modules/my-lib/web',
},
},
],
],
When I try to import a graphql from a library, it gives the following error:
The import that gives the error is something like:
Is this a bug or a limitation? If it's the latter it would be good to have it documented in the readme.
Thanks!