我的项目结构:
/website
/node
/node_module <<-- library root
/type_src <<-- ts files
/src <<-- compiled js files
我曾经是能够这样自动导入根节点模块:
/type_双人床/store/base store.同时:
import {observer} from "mobx-react/native";
@observer
class BaseStore{
}
但最近,汽车进口产生这些节点模块相对路径:
import {observer} from "../../node_modules/mobx-react/index";
@observer
class BaseStore{
}
产生import {observer} from "mobx-react/native";
唯一的办法就是等待红色灯泡展现出来,这是不一样方便。
我创建了另一个项目,它工作正常,但我不知道为什么这个项目突然有这个问题。谁能帮我找出这个问题?
tsconfig:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"moduleResolution": "node",
"removeComments": true,
"allowSyntheticDefaultImports": true,
"noImplicitAny": false,
"sourceMap": true,
"outDir": "./src",
"jsx": "react",
"experimentalDecorators": true,
"noLib": false,
"declaration": false,
"emitDecoratorMetadata": true,
"lib": ["es6", "dom"],
"types": ["reflect-metadata"]
},
"exclude": [
"node_modules"
]
}
基于引用链接,它是(已定)在webstorm错误。
解决方法 - 升级至2017.1或更高