question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple entry points with ng serve

See original GitHub issue

Bug 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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
Broccocommented, May 24, 2017

@jraadt in order to serve the other (mobile) app, you will need to use the --app option…

So ng serve is essentialy running ng serve --app=0 and in order to run the mobile app you would need to run ng serve --app=1.

Note that the 0 and 1 are indexes to the apps array in .angular-cli.json

8reactions
mathertelcommented, Jun 12, 2017

This is exactly what I need as well. How can I vote for this feature ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building an Angular Library with multiple entry points | Articles
First we need to create a new Angular workspace using the Angular CLI. A workspace can contain multiple applications and libraries, but we'll ......
Read more >
angular6 - Angular 6 - multiple Entry points - Stack Overflow
I've found a sort-of solution to this: app.modules.ts: import {ApplicationRef, DoBootstrap, NgModule} from '@angular/core'; ...
Read more >
Multiple Entry Points for the NgxSimpleCharts Angular Library
Simple-Charts With Multiple Entry Points ... The 'peerDependencies' define the required libraries of the application including the library. The ' ...
Read more >
Creating Secondary Entry Points for your Angular Library
In this article, we will take a look at how we can utilise ng-packagr secondary entry points to split our Angular Library even...
Read more >
Multiple entry points | Angular - GitHub Pages
Maybe you are building an application that has multiple urls. An example of this would be a solution where you have two, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found