Marking application assets as Resource Root cause problem with tsconfig lib aliases in Angular NX application

We have set up new Angular NX application with a few libs within it. When in some of the libraries we want to use the exported file from other lib, paths are set according to this which are specified within tsconfig.json
`"baseUrl": ".", "paths": { "@test/session": ["libs/session/src/index.ts"], "@test/resources": ["libs/resources/src/index.ts"], "@test/app-state": ["libs/app-state/src/index.ts"] }`
for example
`import { UserInfo } from '@test/resources';`
After we mark application assets folder as 'Resource Root' Webstorm start using direct paths and do not advice aliases as a possible solution.
`import { UserInfo } from '../../../../resources/src/lib/models';`

3 comments
Comment actions Permalink

What is application assets folder? I've tried marking libs/resources as Resource root, and auto-import stil uses path mappings from tsconfig.json:

Please elaborate on your setup. Sample project would be helpful

 

0
Comment actions Permalink

It is a folder within my application. 

When I mark this directory as 'Resource Route', the problem occurs. In my case, I have marked assets and styles within it.

There is a link to our test setup.
https://github.com/Stefaneek/nrwltest

0

Please sign in to leave a comment.