title: handling multiple applications with angular cli
body: <p>I am interested in being able to bootstrap multiple applications with the angular cli.</p>
  
  <p>Through the angular-cli wiki I was able to find an example
  <a href="https://github.com/angular/angular-cli/wiki/stories-multiple-apps" rel="noreferrer">https://github.com/angular/angular-cli/wiki/stories-multiple-apps</a></p>
  
  <p>Also I found
  <a href="https://yakovfain.com/2017/04/06/angular-cli-multiple-apps-in-the-same-project/" rel="noreferrer">https://yakovfain.com/2017/04/06/angular-cli-multiple-apps-in-the-same-project/</a></p>
  
  <p>I went through the angular-cli.json file and ran </p>
  
  <pre><code>    "apps": [
      {
        "name": "app1",
        "root": "src",
        "outDir": "dist",
        "assets": [
          "assets",
          "favicon.ico"
        ],
        "index": "index.html",
        "main": "main.ts",
        "polyfills": "polyfills.ts",
        "test": "test.ts",
        "tsconfig": "tsconfig.app.json",
        "testTsconfig": "tsconfig.spec.json",
        "prefix": "app",
        "styles": [
          "styles.css"
        ],
        "scripts": [],
        "environmentSource": "environments/environment.ts",
        "environments": {
          "dev": "environments/environment.ts",
          "prod": "environments/environment.prod.ts"
        }
      },
      {
        "name": "app2",
        "root": "src",
        "outDir": "dist2",
        "assets": [
          "assets",
          "favicon.ico"
        ],
        "index": "index.html",
        "main": "main2.ts",
        "polyfills": "polyfills2.ts",
        "test": "test2.ts",
        "tsconfig": "tsconfig.app.json",
        "testTsconfig": "tsconfig.spec.json",
        "prefix": "app2",
        "styles": [
          "styles.css"
        ],
        "scripts": [],
        "environmentSource": "environments/environment.ts",
        "environments": {
          "dev": "environments/environment.ts",
          "prod": "environments/environment.prod.ts"
        }
      }
    ],
  </code></pre>
  
  <p>I was able to get this to run with the following commands</p>
  
  <pre><code>ng serve --app 0
  ng serve --app 1
  </code></pre>
  
  <p>My first question with this approach is how would be maintain this in the case that we list several apps in the <strong>angular-cli</strong>?  This will get a bit much to monitor and track.  </p>
  
  <p>Also, with this approach would you be better off bootstraping a different module in each main.ts file?  </p>
  
  <p>The second way I saw this done was in an example in the comments.<br>
  <a href="https://github.com/Farata/angular2typescript/blob/master/Angular4/router-samples/.angular-cli.json" rel="noreferrer">https://github.com/Farata/angular2typescript/blob/master/Angular4/router-samples/.angular-cli.json</a>.</p>
  
  <p>This is more ideal, although I am unable to replicate and identify how all of these applications share the same dist folders and everything else besides name.  </p>
  
  <p>With the second approach of sharing everything I am wondering how this different than creating a large number of modules and lazy loading them?</p>
  
  <p>I know this question is very theory based but resources online are very limited and I would be interested in knowing how other developers are attacking this issue.</p>