Nested Angular CLI application inside legacy app

Answered

Good morning!

 

I have a legacy Java/Tomcat application which I have a tomcat configuration running perfectly. For our newer UI, we are adding in Angular applications, and therefore have created a sub-directory that houses a git submodule which will house all Angular apps that are built as part of the main repo. Because of this, the nested directory contains everything (e.g. package.json, node_modules, tsconfig). Intellij is complaining about all the different TypeScript problems which looks to be that the IDE doesn't recognize that the tsconfig, package.json, and module resolution should happen within the subdirectory. Is there any way to let Intellij know about this structure? Here is the structure of our repo

legacy_java_root/
|
| --New Angular CLI Project/
|    |- src/
|    |    | - apps/
|    |    |     | - project files
|    |- node_modules/
|    |- package.json
|    |- tsconfig.json

 

0
2 comments

Normally placing Angular project in a subfolder shouldn't cause issues, as the IDE uses the nearest found tsconfig.json current file is included in for types resolving/errors highlighting.

What does your IDE modules structure look like? Can you try composing a sample project the issue can be recreated with? I don't ask for your actual source file - just create a new dummy java project with similar IDEA modules/facets and a new Angular CLI project placed in subfolder

1
Avatar
Permanently deleted user

Awesome, I actually think I figured it out. Over the years, the CLI had different structures and locations of tsconfig.json files. There were some old abandoned ones hanging out in the directory structure of my app. Once I removed them, IntelliJ was happy again. Thanks for letting me know that everything should work! I was assuming it had to do with the subdirectory nature of things.

1

Please sign in to leave a comment.