Open AzaZPPL opened 6 years ago
i think it fix on the vue/cli-service 3.0.1
This is not fixed for now. And the commit 1195aee I think it is not the solution. The document here https://cli.vuejs.org/config/#baseurl about baseurl
cannot help eather.
I tried to hack into /node_modules/@vue/cli-service/
in my local machine, change the options.baseUrl
into my CDN address (which is used by webpack as output.publicPath
, also assetsPublicPath
config in previous vue-cli template) at https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/config/base.js#L37, and then comment the line which throw error at https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/util/validateWebpackConfig.js#L32. Then I build my project, upload to remote host and it finally worked.
Do we really do not need assetsPublicPath
anymore in Vue-Cli v3 ? I doubted.
new Router({ mode: process.env.BASE_URL ? 'history' : 'hash', base: '/', routes: routes })
set the 'base' to '/'
@AzaZPPL @aprilandjan
@rushairer Thanks bro you remind me that the vue-router
base could be configured manually, I almost forgot that - -. So I only need to define my own enviroment variable as router base in webpack config, and this could be solved easily. I just made it tooo complicated, lol.
Maybe the template project with router could be improved to prevent such problems, or the documention could cover this situation. Still I think it is necessary to discriminate assetsPublicPath
to baseUrl
@aprilandjan You are welcome. I met the same problem with you yesterday, and then I saw the 'base:/' unconsciously. 😂
Version
3.0.1
Reproduction link
https://github.com/yangmingshan/vue-cli-issue
Node and OS info
Node: 10.9.0 / npm 6.4.0 / MacOS 10.13.6
Steps to reproduce
baseUrl
invue.config.js
to a CDN url.npm run serve
http://localhost:8080/https://my.cdn.com/
What is expected?
URL should be set to
https://my.cdn.com/
What is actually happening?
Url is set to
http://localhost:8080/https://my.cdn.com/
This issue #1545 was fixed with commit 1195aee. In the later commit 1e7fa2c the fix got removed.