Skip to content

baseUrl should handle full urls #2877

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

Closed
dsanders11 opened this issue Nov 2, 2018 · 4 comments
Closed

baseUrl should handle full urls #2877

dsanders11 opened this issue Nov 2, 2018 · 4 comments

Comments

@dsanders11
Copy link

What problem does this feature solve?

Per the docs, "The base URL your application bundle will be deployed at. This is the equivalent of webpack's output.publicPath". In the webpack docs it's clear full urls are valid, one of the examples is 'https://cdn.example.com/assets/'.

From the docs for devServer.publicPath: "It is also possible to use a full URL. This is necessary for Hot Module Replacement." The point about HMR is clear when you look at issue 2525, where the HMR is using the wrong URL for updates.

Setting baseUrl to a full URL results in a message from vue-cli-service serve such as:

App running at:

It does fix the HMR issue, since it plumbs down correctly, but vue-cli isn't treating it as the full URL that it is.

If baseUrl is the equivalent of webpack's output.publicPath as the docs say, then it must correctly handle full URLs. Otherwise they are not equivalent.

What does the proposed API look like?

N/A

@LinusBorg
Copy link
Member

LinusBorg commented Nov 2, 2018

Thanks for bringing this up. It should be a bug report though, I f´think - at least the console output seems not right.

@dsanders11
Copy link
Author

@LinusBorg, I was going to make it a bug report but the helper format seemed too restricting with the reproduce steps requirement. I'm not sure if the console output is simply a cosmetic issue, or if there are other issues which occur when a full URL is provided. I haven't poked it enough to know.

@LinusBorg
Copy link
Member

LinusBorg commented Nov 2, 2018

I was going to make it a bug report but the helper format seemed too restricting with the reproduce steps requirement.

You can just create an example project and push it to github. Reproduction done.

But I think we can get along without it in this case. ;)

I've taken a look. So far, it really seems so be a cosmetic issue only. It's because serve also accepts --host and --port options (or matching environment variables) to define on which host:port combo to make the devServer listen (the defaults being localhost:8080).

so for the console output when running serve, we basically do

`${host}:${port}/${baseUrl}`

... which is how the strange double-url in the console comes about.

For the webpack config's output.publicPath though, we use the baseUrl only.

@haoqunjiang
Copy link
Member

Fixed in #2900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants