В LayaBox я устанавливаю baseurl = "./src"
в tsconfig.json
, чтобы использовать import ViewBase
из "core/view/ViewBase"
вместо "../../../core/view/ViewBase"
.
Но я компилирую код и получаю ошибку:
Error: Cannot find module 'core/view/ViewBase' from 'E:\developer\project\svn_wjbj\endLess\src'
at E:\developer\LayaAirIDE_beta\resources\app\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17
at process (E:\developer\LayaAirIDE_beta\resources\app\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43)
at ondir (E:\developer\LayaAirIDE_beta\resources\app\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)
at load (E:\developer\LayaAirIDE_beta\resources\app\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43)
at onex (E:\developer\LayaAirIDE_beta\resources\app\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
at E:\developer\LayaAirIDE_beta\resources\app\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47
at FSReqWrap.oncomplete (fs.js:114:15)
LayaBox2.0, Машинопись
tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noEmitHelpers": true,
"sourceMap": false,
"baseUrl": "./src",
"paths": {}
},
"exclude": [
"node_modules"
]
}
import ViewBase from "core/view/ViewBase";
import { BLACK_TYPE, CLICK_TYPE } from "core/view/BlackBG";
import { UIPANEL } from "core/view/UIRoot";
import MessageBox from "core/view/notify/MessageBox";