New TSConfig Management
See original GitHub issueType of Issue
[ ] Bug Report
[ ] Feature Request
[x] discussion
Description
This discussion is created in order to permit a more global discussion about TSConfig management, customisation and refactoring, directly following https://github.com/dherges/ng-packagr/pull/790#discussion_r183844424.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
TSConfig Reference - Docs on every TSConfig option
ECMAScript 6 added several new iteration primitives: the for / of loop ( for (el of arr) ) ... To control which folders...
Read more >Proposal: Support for multiple tsconfig.json per project #6109
The new command line parameter (e.g. -browseConfig ) should require a directory information, similar to the -project command line parameter.
Read more >How to handle a project with multiple tsconfig.json files?
you can do this by extending your base tsconfig.json file: tsconfig extension. just do not exclude directories in the base tsconfig.json and typescript ......
Read more >Exploring advanced compiler options in TypeScript
The tsconfig.json file specifies compilation options used by the TypeScript compiler, which applies checks to our code and determines whether ...
Read more >Dealing with TypeScript configs for the mono-repo ...
Put your TypeScript config (tsconfig.json) into the root folder. Then define rootDir and place there the frontend app folder name, like this. {...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you take into consideration a mono repo for example, that you mentioned. It is vital that the tsconfig is not part of static options. And you have a
tsconfig
with a custombaseUrl
andpaths
to work. In fact I do have a starter kit for this which you can see here.https://github.com/alan-agius4/ng-mono-repo-starter/blob/master/tsconfig.json https://github.com/alan-agius4/ng-mono-repo-starter/blob/master/tsconfig.build.json
Having full control of a tsconfig, Outside of ng-packagr is essential for this, As i rely on the ngc to properly parse the paths etc and not
ng-packagr
. As I said early, you cannot simply get some options and merge them with tsconfig, as this simple won’t work because when a tsconfig is parsed, it does much more than merging an object.My point is, we should allow a full custom
tsconfig
, this is something quite important in my use cases. In case the user provides invalid configuration than we should warn them. By removing the functionality would have a huge impact.Note on point 1 If the tools provide adequate error message why people are finding it hard to set up a valid tsconfig? In reality there are only 2-3 properties required. Tbh, its the same for ng cli if you create an invalid tsconfig it wont work. So, I think the best approach rather than merging etc, we should use a schematic and than just modify the values that need to be modified during build such as the output and declarationDir, baseUrl. etc. (Which are currently doing)
Note on point 3 You mentioned this requires refactoring, but in reality it doesn’t it just needs to revert this https://github.com/dherges/ng-packagr/pull/786/files, and it will just work out of the box, because tsconfig paths gets parsed by tsc/ngc
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
This action has been performed automatically by a bot.