Open ViktorAksionov opened 6 years ago
Have you got any solution yet ! ?
I ended up with removing key root
and added alias like:
"alias": {
"app": "./src/app",
"config": "./src/config",
....
}
so now imports work as I expected:
import Modal from 'app/components/Modal';
or
import {Modal} from 'react-native';
- now plugin resolved files as it should.
Looks like root
key is not mandatory and it creates issue with correct file resolving.
@ViktorAksionov Out of curiosity, would you have a small repro project with the issue? This is the first time I hear that the root configuration is making a deep resolution...
"babel-plugin-module-resolver": "^3.1.1"
.babelrc
Project file structure
when I do import like this
import {Modal} from 'react-native';
somehow I importModal
from my project instead of from 'react-native'. Why?? How to prevent babel-plugin-module-resolver to go in deep? I want only to resolveapp
and nothing else, so resolver should care only about import starting fromapp
likeimport ... from 'app/...';