ng-packagr icon indicating copy to clipboard operation
ng-packagr copied to clipboard

Use different tsconfig for secondary entry points

Open dirkluijk opened this issue 6 years ago • 2 comments
trafficstars

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

dirkluijk avatar Jan 04 '19 10:01 dirkluijk

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.

shlomiassaf avatar Jan 22 '19 00:01 shlomiassaf

One of the examples I show is how to modify tsconfig settings 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

GerkinDev avatar Apr 24 '21 01:04 GerkinDev