-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
The builder prepend '/' on publicPath when using custom protocol publicPath #4184
Comments
Hope can add an option to prevent calling this ensureSlash function.
|
my protocol is widget:// and i fix it in plugin:
|
My workaround is using setter and getter to intercept the change: /**
* vue.config.js
*/
const config = {
publicPath: 'customprotocol://www.my-app.com/'
}
// prevent the change of publicPath starting with '/'
Object.defineProperty(config, 'publicPath', {
set: function (val) {
if (/^\/[^\/].+/.test(val)) {
val = val.replace('/', '')
}
_publicPath = val
},
get: function () {
return _publicPath
}
})
module.exports = config |
haoqunjiang
added a commit
to haoqunjiang/vue-cli
that referenced
this issue
Nov 8, 2019
fixes vuejs#3338 fixes vuejs#4184 Actually I don't know why the slash was added in the first place, seems extraneous to me.
9 tasks
haoqunjiang
added a commit
that referenced
this issue
Nov 9, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
3.8.4
Environment info
Steps to reproduce
What is expected?
<link href=customprotocol://www.my-app.com/js/app.3a07a650.js rel=preload as=script>
What is actually happening?
<link href=/customprotocol://www.my-app.com/js/app.3a07a650.js rel=preload as=script>
In our APP, we will intercept the assets with customprotocol and get them from local cache. Please provide an option to allow using publicPath not starting with
https?
.The text was updated successfully, but these errors were encountered: