-
Notifications
You must be signed in to change notification settings - Fork 12k
ng build v6 does not use paths section of root tsconfig.json #10444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
ng build
v6.0.0 does not use paths
section of root tsconfig.json
Current workaround: Modify the various |
I have the same issue but when I look back the whole structure of angular 5 app and I found that there is one more tsc file with name is |
@haovanvo - Yes, I see that file as well, but only in the app. There doesn't seem to be an equivalent tsconfig.lib.json when invoking |
Having said that, I think this bug might have been fixed by angular/devkit#750 |
Confirmed, I've got it working, though it required more than just an 'out-of-the-box' experience. The changes I needed were:
@hansl - I'd be happy to add this to the library schematic, however I'm not quite certain how to manage paths generation of the |
I was trying to create a mono repo project and I stumble upon the same issue. After hours of diagnosing the issue, I reached out the same conclusion @krotscheck mentioned. NgPackagr will overwrite The workaround is manually adding the path to either one more thing The same thing well happen if you want to reference your lib in another app, you have to add another path relative to the app directory this time not relative to src. Of course this is not related to ng-packagr. Your tsconfig.json will end up something like this:
|
Heya, I think the problems described in this issue are partially the same as #10615. angular/devkit#895 (using the right paths for scoped libs) together with ng-packagr/ng-packagr#862 (not overriding baseUrl in ng-package) should fix it. |
Damn @haovanvo you saved me so many hours with your comment... I've already spent +1h going mad, not understanding why my lib couldn't be loaded directly and I probably came accross +10 outdated issues and 3 or 4 unanswered questions on SO. But overriding the Thanks! |
the same problem!!! |
Well, I tried many different types of configurations, described above, but still having problem - path resolution/intelliscence in angular components are working.. but stoped working corresponding temaplates (i.e, in say, Ionic 4 project language service normally identifies ion-* tags but not my custom ones).. |
@VovanSuper might have the problem I just did, make sure you're editing |
if tsconfig.app.json extend tsconfig.json then you only need to add it to tsconfig.json and then restart VSCode. Example with angular8
|
What about using the library in another client application ? Do we need to specify the paths mappings in each client application as well ? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
projects/*
.ng build
.Observed behavior
If running
ng test
, the project resolves/tsconfig.json
at per each library's./project/libraryA/tsconfig.spec.json
. The roottsconfig.json
has an automatically managedpaths
block, linked with the output directories.Running
ng build
, it appears that we don't invoke ng-packagr using that tsconfig.json file, or even resolve thepaths
block, resulting in a slew of errors of this sort:Desired behavior
It should be possible to provide a
paths
block for dependency resolution during the build step.Mention any other details that might be useful (optional)
I'm working through a full migration on a public project here:
https://github.com/kangaroo-server/kangaroo-ui/tree/feature/ng6
Repro steps on that repo:
The text was updated successfully, but these errors were encountered: