Module resolution setting not respected
See original GitHub issueType of Issue
[x] Bug Report
[ ] Feature Request
Description
I have a tsconfig.json
with the custom configuration of paths. Each path alias has two entries, with a dist
and a projects
folder(for debugging purposes).
After the update to ng-packagr@4.6.0
my library build is failing with the following error pattern:
TS6059: File 'absolute-path/projects/my-project/src/lib/my-project.module.ts' is not under 'rootDir' 'absolute-path/projects/my-other-project/src'. 'rootDir' is expected to contain all source files.
I figured that the commit causing this is 3f56df2, which forces us into Classic
TypeScript module resolution, which quite frankly makes no sense.
From TypeScript documentation:
This used to be TypeScript’s default resolution strategy. Nowadays, this strategy is mainly present for backward compatibility.
Question: If that was done to assure some sort of backward compatibility, should people that require it do it themselves?
How To Reproduce
Checkout: https://github.com/klemenoslaj/ng-packagr-module-resolution-bug
Execute: ng build library && ng build library2
Expected Behaviour
- Developers should be able to customize their TypeScript paths the way it makes sense for them
- The configuration developer maintains should actually be the one configuring TypeScript
Version Information
Angular CLI: 7.2.4
Node: 10.15.0
OS: darwin x64
Angular: 7.2.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.12.4
@angular-devkit/build-angular 0.12.4
@angular-devkit/build-ng-packagr 0.12.4
@angular-devkit/build-optimizer 0.12.4
@angular-devkit/build-webpack 0.12.4
@angular-devkit/core 7.2.4
@angular-devkit/schematics 7.2.4
@ngtools/json-schema 1.1.0
@ngtools/webpack 7.2.4
@schematics/angular 7.2.4
@schematics/update 0.12.4
ng-packagr 4.7.0
rxjs 6.3.3
typescript 3.2.4
webpack 4.28.4
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Because only relative files are resolved, hence node_modules will not be part of the compilation, which causes a thinner program to the created, and less files loaded in memory.
I’ll try to look into this, in the coming days.
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.