Closed huruji closed 5 years ago
Oh interesting, I did not even know protocol relative urls existed! (https://www.paulirish.com/2010/the-protocol-relative-url/)
I'll have a look and see if there's an easy fix. Of course, a PR would be welcome if you'd like to have a look yourself... ;-)
well, I will have a look tommorrow when I am free.
Actually, there's a very easy fix for this. The /
prefix is being added to your url because this is your publicPath
from webpack.
If you add publicPath: false
to your asset it should work, like this:
{
path: '//polyfill.alicdn.com/polyfill.min.js',
publicPath: false,
type: 'js',
attributes: {
crossorigin: 'anonymous'
}
}
Can you give that a try and let me know if that fixes it?
oh, it works @jharris4
Great, glad it was an easy fix!
I want to inject a script which via HTTPS when needed:
But the
.html
output added a/
, the link was///polyfill.alicdn.com/polyfill.min.js
, It was wrong.Env