Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng serve documentation (specifically --public-host/live-reload-client) #8986

Closed
dtabaka opened this issue Dec 24, 2017 · 6 comments
Closed
Assignees
Labels
area: @angular/cli area: @angular-devkit/build-angular area: docs Related to the documentation devkit/build-angular:library P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release type: bug/fix
Milestone

Comments

@dtabaka
Copy link

dtabaka commented Dec 24, 2017

Versions

Node 6.11.2, Npm 5.6.0, Angular CLI 1.5.0, Angular 5, Asp.NET Core 2.0, Visual Studio 2017

Repro steps

I'm integrating the Angular CLI with Visual Studio 2017 & an ASP.NET Core 2.0 application where I successfully have the live reloading working when I make a change to my Angular components. I have the following script tags in my _layout.cshtml during development.

<script type="text/javascript" src="http://localhost:4200/inline.bundle.js"></script>

etc.

Desired behavior

However, for this to work I stumbled upon a post that mentioned I had to configure my package.json "start" script as follows:

"scripts": {
"start": "ng serve --live-reload-client http://localhost:4200/",

I would like:
1.) To better understand this and what it is doing behind the scenes. From what I understand ng serve uses webpack dev server under the covers so I'm wondering how this configures it or what the equivalent setting in the webpack.config.json file would be.

2.) ng serve docs have this listed as public-host (aka live-client-reload) but not much more than that. If there was more information it might help clear up 1.)

@filipesilva filipesilva added area: docs Related to the documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Dec 26, 2017
@hansl hansl unassigned clydin Feb 6, 2018
@Splaktar
Copy link
Member

Splaktar commented Dec 1, 2018

There are docs now in https://angular.io/cli/serve, but it's still not clear what --public-host really does and there are no examples of how/when this would be useful.

All it says is "Specify the URL that the browser client will use."

I came to the docs trying to fix an issue with live reload on Chrome OS. Not mentioning live reload and public host are related cost me a good bit of time and frustration.

@jbogarthyde @jenniferfell this docs issue is closer to being addressed now. I think a little bit of refinement to the existing ng serve docs should solve this.

@Splaktar
Copy link
Member

Splaktar commented May 28, 2019

A related change was made in 7.3.0 via 4729397.

@Splaktar
Copy link
Member

But it appears that previous PR only changed one entry for this, but there are multiple. #14538 is working to address this for the dev-server builder.

The documentation for this on AIO has not been updated or improved, so this issue is not yet resolved.

@Splaktar
Copy link
Member

It looks like the dev-server builder schema is the right place. That change in #14538 should cause the AIO docs to update properly and fix this issue.

@jbogarthyde
Copy link
Contributor

Fixed by PR #14538

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli area: @angular-devkit/build-angular area: docs Related to the documentation devkit/build-angular:library P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants