Command serve feature: Allow content to be served from virtual host path#2727
Command serve feature: Allow content to be served from virtual host path#2727suau wants to merge 10 commits intoangular:masterfrom
Conversation
|
The Would it make sense for the |
|
@Meligy yes, that sounds very reasonable, since the base-href needs to be changed as well to make virtual host path work properly. |
|
Hi, can you first open the issue that the PR is trying to address? You seem to be trying to do something like #2276, but since you're only doing that in |
|
@filipesilva the |
|
@suau can you please fix the merge conflict? |
# Conflicts: # packages/angular-cli/custom-typings.d.ts # packages/angular-cli/tasks/serve-webpack.ts
…. This option now also sets the base-href tag in index.html to match the virtual path.
|
@Meligy done, I also renamed the param to @filipesilva this option is used for local development only and used to emulate |
filipesilva
left a comment
There was a problem hiding this comment.
Ok I see what you're trying to do. Can you add a new test in https://github.com/angular/angular-cli/blob/master/tests/e2e/tests/test/e2e.ts to make sure it's correctly served?
# Conflicts: # packages/angular-cli/custom-typings.d.ts # packages/angular-cli/tasks/serve-webpack.ts
…fail, but it doesn't.
|
@filipesilva I'm having some issues writing a reasonable e2e test for this:
I'm not sure what to do to write a useful e2e test. Input would be appreciated. |
|
Very weird that the test is passing I tried it locally and could see the app being served correctly: And the test failing: I can also see in travis that it did run the test and reported positive... https://travis-ci.org/angular/angular-cli/jobs/177204174#L3929-L3964 Tbh I don't know why it's passing but it definitely shouldn't, otherwise we can't test the feature. Do me a favor, edit the test to look like this (adding a fail expectancy and editing the e2e test) and I'll investigate further: |
|
@filipesilva For a second I thought it's a OS X / Windows command line escaping issue, but since AppVeyor fails now too, it probably isn't. Can you confirm that the first relevant test fails on windows too ? (the one where it's expected to fail, but succeeded) |
|
Superseded by #3285, as it is more complete. |
|
Please correct me if I'm wrong but it seems like #3285 still doesn't solve the problem described here. All I want is to have my " I tried adding If there's a way to do what I want with the current tools, I'd be very grateful for an explanation. If not, then it seems this issue should be re-opened. Furthermore, it seems a bit odd to me that the " Finally, the documentation for both of these options ( |
|
OK, after even more trial and error I discovered that the " Am I doing something wrong here or has anyone else come across similar issues before? I'm just about ready to tear my hair out! |
…i.json for webpack-dev-server This adds support for publicPath to webpack-dev-server via ng serve The server would have to be started like ng serve --deploy-url /deploypath --base-href /deploypath. The app will be served from http://localhost:4200/deploypath Should fix angular#2727
|
Hi, @mischkl |
…i.json for webpack-dev-server This adds support for publicPath to webpack-dev-server via ng serve The server would have to be started like ng serve --deploy-url /deploypath --base-href /deploypath. The app will be served from http://localhost:4200/deploypath Should fix #2727
|
I just merged #6112, that should fix that. |
|
Great news! Thanks @scriste-sv + @filipesilva :) |
|
I tried doing this way ng serve --deploy-url /deployPath/ --base-href /deployPath/ but still i am getting 404 for http://localhost:4200/deployPath/inline.bundle.js AM i missing something ? |
…i.json for webpack-dev-server This adds support for publicPath to webpack-dev-server via ng serve The server would have to be started like ng serve --deploy-url /deploypath --base-href /deploypath. The app will be served from http://localhost:4200/deploypath Should fix angular#2727
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |

Feature: Allow content to be served from virtual host path e.g. http://example.com/admin/
Fix #3010