ng-packagr
ng-packagr copied to clipboard
Use different tsconfig for secondary entry points
Type of Issue
[ ] Bug Report
[X] Feature Request
Description
I want to use a different tsconfig for my secondary entry points because I use different typings for them. Currently, when I load both typings, they have conflicts.
The primary entry point uses @types/jasmine and the secondary entry point uses @types/jest. The latter one conflicts the first one (on purpose), but I can solve this when I use a different tsconfig for the secondary entry point.
How To Reproduce
n/a
Expected Behaviour
Being able to provide a tsconfig in "ngPackage" file so that it is being used for primary / secondary entry points.
Version Information
n/a
This is very tricky because the tsconfig in secondary entry points must be able to resolve other packages (other secondaries or the primary).
It needs to resolve it in the dist (resolve the output lib) and not from the actual source code.
I have built a replacement for @angular-devkit/build-ng-packagr:build called ng-cli-packagr-tasks that provide hooks to customise ng-packagr at various points in the build process.
One of the examples I show is how to modify tsconfig settings in secondary entry points
It's quite simple.
One of the examples I show is how to modify
tsconfigsettings in secondary entry points
Updated link: https://github.com/shlomiassaf/ng-cli-packagr-tasks/blob/master/examples/update-tsconfig-for-secondary-entry-points/update-tsconfig-for-secondary-entry-points.ts