angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Add possibility to move tsconfig.json (angular-cli.json)

Open serhiisol opened this issue 10 years ago • 8 comments

So basically I have problems with editor like VSCode. It expects to have tsconfig.json at the project root directory. And it seems like CLI skips angular-cli.json tsconfig option When I did that I've got next problem:

  1. Mac OSX El Capitan

  2. angular-cli: 1.0.0-beta.4 node: 5.7.1 os: darwin x64 3.

    1. Move tsconfig.json to the project root directory
    2. change angular-cli.json file
    3. change configuration of tsconfig.json
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: ENOENT: no such file or directory, open '/Users/serhiysolonko/Development/Projects/WebApp/tmp/broccoli_type_script_compiler-input_base_path-jNRnmJYp.tmp/0/src/tsconfig.json'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at BroccoliTypeScriptCompiler._loadTsConfig (/Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:123:34)
    at BroccoliTypeScriptCompiler._createServiceHost (/Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:158:25)
    at BroccoliTypeScriptCompiler.build (/Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:41:12)
    at /Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/node_modules/broccoli-caching-writer/index.js:152:21
    at lib$rsvp$$internal$$tryCatch (/Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (/Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (/Users/serhiysolonko/Development/Projects/WebApp/node_modules/angular-cli/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1198:9)
    at _combinedTickCallback (node.js:370:9)
    at process._tickCallback (node.js:401:11)

screen shot 2016-05-20 at 12 57 45 pm

serhiisol avatar May 20 '16 11:05 serhiisol

Do you still have this? I'm running VSCode on CLI projects and it seems to be fine. I'll reopen if it still happens to you.

filipesilva avatar Jun 02 '16 15:06 filipesilva

@filipesilva moving tsconfig.json seems not working for me.

  1. I pulled code, master branch
  2. made sudo npm link from repository folder
  3. npm link angular-cli from project folder.
  4. changed angular-cli.json apps[].tsconfig option
  5. ran ng serve

Stack trace is the same.

Should I do something specific ?

PS. I don't see problem in VSCode anymore, they fixed tsserver issue, but still having issue with moving tsconfig.json

serhiisol avatar Jun 06 '16 11:06 serhiisol

Right you are, the location of tsconfig.json in angular-cli.json isn't being used in the build system: https://github.com/angular/angular-cli/blob/master/lib/broccoli/angular2-app.js#L320

filipesilva avatar Jun 07 '16 17:06 filipesilva

Any updates ?

BANG88 avatar Jul 05 '16 03:07 BANG88

Any help ? !!

samirthebti avatar Jul 06 '16 21:07 samirthebti

@filipesilva but how can we add this possibility?

serhiisol avatar Jul 07 '16 08:07 serhiisol

I don't think we'll be implementing this option as presented any time soon. Moving the tsconfig has serious implications in project compilation and it really should be at the root of the app.

It's perfectly valid to have a tsconfig at any depth of a project as well, and a project can have several tsconfig files. That makes me think that the problem might be related to the editor rather than the project.

There might also be other editor issues that manifest the way you are showing, for instance https://github.com/Microsoft/vscode/issues/9232 (I suffer from this one myself).

filipesilva avatar Jul 27 '16 02:07 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.