Skip to content

fix(cli-service): do not log absolute baseUrl in terminal, close #2877 #2900

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

Merged
merged 1 commit into from
Nov 12, 2018

Conversation

jkzing
Copy link
Member

@jkzing jkzing commented Nov 6, 2018

@@ -89,7 +90,7 @@ module.exports = (api, options) => {
protocol,
host,
port,
options.baseUrl
isAbsoluteUrl(options.baseUrl) ? '/' : options.baseUrl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't that break for baseUrl: http://localhost:8081/someBasePath/ ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set baseUrl to http://localhost:8081/someBasePath/ doesn't mean to start the dev-server on localhost:8081, the dev-server would still be started on ${host}:${port}.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but doesn't the console now say " go to host: port/" even though people would have to go to "localhost:port/baseurl"?

I'm honestly confused because paths and hosts in webpack can be confusing as hell to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider those two cases here:

  1. Asset files (js/css/img) are served by webpack-dev-server (eg. localhost:8080), and user uses a reverse proxy to access the html (eg. localhost:3000/app/). In this case, baseUrl should be set to http://localhost:8080/, but user need to open http://localhost:3000/app/ in browser.

  2. Asset files (js/css/img) are served by webpack-dev-server (eg. localhost:8080), and user uses a reverse proxy to access the asset files (eg. localhost:3000/assets/). In this case, baseUrl should be set to http://localhost:3000/assets/, and user need to go to http://localhsot:8080 in browser.

What I want to say is, we cannot infer which url should user open in browser if user set baseUrl to a absolute url. What we can do is tell user "we have started your dev-server on localhost:8080"...

And, yes it is confusing. 😂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, that was very helpful. Thanks.

@haoqunjiang haoqunjiang merged commit 6d35461 into vuejs:dev Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants