I know in webpack you can set the publicPath to a cdn URL like so:
// Example CDN
output: {
path: "/home/proj/cdn/assets/[hash]",
publicPath: "http://cdn.example.com/assets/[hash]/"
}
but how do you accomplish the trick of having multiple CDN aliases to improve load performance?
eg:
I don't think webpack supports that yet. I had a quick look at the source and it seems to expect a static value. You probably should open an issue unless you can find a matching one.
As a temporary hack you could try something a little clever. Set publicPath
to something that's easy to replace. Then, using another script, detect those and perform replacement according to your logic. That might be a good workaround for now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With