Multiple apps are now supported out of the box.
Angular CLI support multiple applications within one project. You use
the apps array in .angular-cli.json to list files and folders you want
to use for different apps.
"apps": [
{
"root": "src",
...
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
...
},
{
"root": "src",
...
"main": "main2.ts",
"polyfills": "polyfills2.ts",
"test": "test2.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app2",
...
}
]
To serve the first app: ng serve --app=0 or ng serve --app 0
To serve the second app: ng serve --app=1 or ng serve --app 1
Hope it helps, someone!!