定義所以我得到這個錯誤:app.component.ts沒有項目由tsconfig.json
File C:/wamp/www/angular2_demo/GiphySearch/src/app/app.component.tsis not in project defined by C:/wamp/www/angular2_demo/GiphySearch/e2e/tsconfig.json
我的文件夾結構
/
/e2e/tsconfig.json
/src
(others)
tsconfig.js有這個內容
{
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"mapRoot": "",
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": false,
"rootDir": ".",
"sourceMap": true,
"sourceRoot": "/",
"target": "es5"
}
}
我試圖更改rootDir
或sourceRoot
,將其定義爲../
或../src
或/src
但沒有任何工作。應該如何正確配置?
你試過'。/ src'嗎?我的angular-cli生成的tsconfig位於/ src裏面,只包含''mapRoot「:」./「' – j2L4e
仍然不能正常工作 – Pentium10