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.

Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
  • 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. – Benjamin Schäublin Jan 28 '18 at 20:53
  • @maerlin I saw that structure in jhipster ... so I thought it's fine. – Denis Stephanov Jan 28 '18 at 21:03
  • Did you take a look into http://www.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. – Benjamin Schäublin Jan 28 '18 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. – Denis Stephanov Jan 28 '18 at 21:15
  • Why is this down voted? – Fredrik Lundin Jan 28 '18 at 21:47

1 Answers1

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

Fredrik Lundin
  • 8,006
  • 1
  • 29
  • 35