4

I want to start new Angular 5 project, but I need that my code will be in another folder than configuration files. Is possible to do that in cli commands?

For example here is my folder structure:

-/root
-/src/main/java
-/pom.xml

After generation Angular 5 project I need that, configuration files will be in root and source codes in src/main/webapp like that:

-/root
-/src/main/java
-/src/main/webapp
-/src/main/webapp/app
-/src/main/webapp/index.html
-/src/main/webapp/...
-/pom.xml
-/.angular-cli.json
-/package.json
-/...

Is it possible? If yes how? Thanks.

5
  • i dont think its possible as angular cli is made for generating new project easily and taking care of best practices using angular. And your folder structure is definitly not following best practices. Commented Jan 28, 2018 at 20:53
  • @maerlin I saw that structure in jhipster ... so I thought it's fine. Commented Jan 28, 2018 at 21:03
  • Did you take a look into jhipster.tech/using-angular ? the structure looks different than yours - and they have a chapter about angular-cli, like the generation of components and their custom angular-cli config. seems to me you mixed up your java project files with with angular project files, instead of having them separated. Commented Jan 28, 2018 at 21:11
  • @maerlin yes this is what I mean ... index.html, components, content and other code in .../webapp and configuration like package.json, cli setting, and such stuff in root like pom file. Commented Jan 28, 2018 at 21:15
  • Why is this down voted? Commented Jan 28, 2018 at 21:47

1 Answer 1

5

I'm your angular-cli.json file, you have an option called root that is used for specifying the directory of your apps root folder, relative to your configuration file.

You could for example put, a path like this, which might fit your need:

"root": "src/main/webapp/app",

Here is the documentation: https://github.com/angular/angular-cli/wiki/angular-cli

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.