babel-plugin-module-resolver
babel-plugin-module-resolver copied to clipboard
help: using with submodules
I have this git submodule named Shared in the parent project. I use absolute path in submodule like import A from 'src/components/...' that wouldn't work in parent project because src/components actually reside in shared/src/components/... as parent importing it. I wonder if there is anyway I could solve the problem using babel-plugin-module-resolver?
this is how my tree look like:
-shared
-src
-components
-other files...
-node_module
-src
so far I tried to create babel.config.js in the Shared folder with no luck
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
root: ['./src']
}
]
]
};
@zeitamin , did you ever find a solution? I'm working on this issue now.