Reactjs VS代码、React项目、使用绝对导入路径时的intellisense
在我的react项目中,当我在中使用时:Reactjs VS代码、React项目、使用绝对导入路径时的intellisense,reactjs,visual-studio-code,components,intellisense,absolute-path,Reactjs,Visual Studio Code,Components,Intellisense,Absolute Path,在我的react项目中,当我在中使用时: //package.json "name": "app" 那么intellisense不适用于绝对路径导入 //SomeComponent.js import {StorageKeys} from 'app/Constants' // inellisense dont work import {StorageKeys} from '../../Constants' // intellisense works
//package.json
"name": "app"
那么intellisense不适用于绝对路径导入
//SomeComponent.js
import {StorageKeys} from 'app/Constants' // inellisense dont work
import {StorageKeys} from '../../Constants' // intellisense works
尝试了一些关于“jsconfig.json”和设置编译器的基本url的建议,但没有成功。
有什么想法吗?好的,再看一次RTFM和RTFM
{
"compilerOptions": {
"target": "ES6",
"baseUrl": "./",
"paths" : {
"app/*" : ["./*"]
}
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}