Multiple entry points with ng serve
See original GitHub issueBug Report or Feature Request (mark with an x)
- [ ] bug report -> please search issues before submitting
- [ x] feature request
Versions.
@angular/cli: 1.0.4 node: 7.9.0 os: darwin x64 @angular/animations: 4.1.3 @angular/common: 4.0.2 @angular/compiler: 4.0.2 @angular/core: 4.0.2 @angular/forms: 4.0.2 @angular/http: 4.0.2 @angular/material: 2.0.0-beta.5 @angular/platform-browser: 4.0.2 @angular/platform-browser-dynamic: 4.0.2 @angular/router: 4.0.2 @angular/cli: 1.0.4 @angular/compiler-cli: 4.0.2
Desired functionality.
Is it possible to have multiple entry points available from ng serve? I’m building an application that has multiple urls. My main app is index.html and is working great. I would like to add a minimal mobile version of my app with reduced functionality at mobile.html that shares a lot of the code, but I don’t want to load all the features used in my main app. So along with main.ts I would like to create a mobile.ts that bootstraps my MobileModule instead of AppModule if mobile.html is called instead of index.html. I just want to call ng serve on my project and have it use the different entry points depending on if I call index.html or mobile.html. Is that possible or do I have to eject?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:8 (2 by maintainers)

Top Related StackOverflow Question
@jraadt in order to serve the other (mobile) app, you will need to use the
--appoption…So
ng serveis essentialy runningng serve --app=0and in order to run the mobile app you would need to runng serve --app=1.Note that the
0and1are indexes to the apps array in.angular-cli.jsonThis is exactly what I need as well. How can I vote for this feature ?