Description
Bug Report or Feature Request (mark with an x
)
- [] bug report -> please search issues before submitting
- [x] feature request
Versions.
@angular/cli: 1.4.4
node: 6.11.3
os: linux x64
@angular/animations: 4.4.4
@angular/common: 4.4.4
@angular/compiler: 4.4.4
@angular/core: 4.4.4
@angular/forms: 4.4.4
@angular/http: 4.4.4
@angular/platform-browser: 4.4.4
@angular/platform-browser-dynamic: 4.4.4
@angular/router: 4.4.4
@angular/cli: 1.4.4
@angular/compiler-cli: 4.4.4
@angular/language-service: 4.4.4
typescript: 2.3.4
Repro steps.
This improvements refers mainly to vscode/#24362 but i think it will be reproduced by other editors in the future as well. Currently the main (and only) typescript config file parsed by editors is tsconfig.json
. Since the files ./src/tsconfig.app.json
and ./src/tsconfig.spec.json
both contains"baseUrl": "./"
but there is no baseUrl
property in ./tsconfig.json
which they both extend there is no way for the common editor to know what the main baseUrl
is and it will struggle with resolving and refactoring absolute imports (although compiling with ng build
works fine).
The log given by the failure.
For example just "out of the box" app after ng new
and changing one relative import to absolute one produces :
Desired functionality.
if (as I wrote here) the baseUrl
property will be moved from ./src/tsconfig.app.json
and ./src/tsconfig.spec .json
files to ./tsconfig.json
and it will hold there "baseUrl": "./src/"
it will solve the issue and will create better parsing for other editors in the future.