Bug Report
Current Behavior
I have created the file .babelrc
in the root of my React native project and install all related node_modules related to that. Go to definition with VSC with any of these paths not working. I have provided example below in the file with the supported attached png.
import { getMediaAll } from 'actions/categories';
Expected behavior/code
When I import any variable with the file path defined with the below parameters it should to go the definition with VSC.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
- Filename:
.babelrc
{
"plugins": [
[
"module-resolver",
{
"root": ["./src"],
"extensions": [".js", ".ios.js", ".android.js"],
"alias": {
"assets": "./src/assets",
"components": "./src/components",
"config": "./src/config",
"navigation": "./src/navigation",
"atoms": "./src/atoms",
"actions": "./src/redux/actions",
"reducers": "./src/redux/reducers",
"screens": "./src/screens",
"services": "./src/services",
"theme": "./src/theme"
}
}
]
]
}
Environment
System:
OS: macOS 10.15.1
Binaries:
Node: 10.16.3 - /usr/local/bin/node
npm: 6.11.3 - ~/.npm-packages/bin/npm
npmPackages:
babel: ^6.23.0 => 6.23.0
babel-plugin-module-alias: ^1.6.0 => 1.6.0
babel-plugin-module-resolver: ^3.2.0 => 3.2.0
babel-plugin-transform-remove-console: 6.9.4 => 6.9.4
babel-preset-expo: ^8.0.0 => 8.0.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4
Closing this as it duplicates tleunen/babel-plugin-module-resolver#321 and babel is not aware of any specific plugin options, in this case it’s
babel-plugin-module-resolver
.According to tleunen/babel-plugin-module-resolver#321 (comment), please add a new
jsconfig.json
so VSC knows thatcomponents
should be resolved to./src/components/
.