Webpack code-splitting bundles hosted over two servers

70 Views Asked by At

My React SSR app loads modules at runtime when it knows which are needed.

Webpack splits and bundles the code.

The SSR app is hosted on server A, and the bundles must, for reasons beyond my control, be hosted on server B.

How can I let Webpack know to load the modules from B, not A?

1

There are 1 best solutions below

0
On BEST ANSWER

Setting [publicPath][1] to an absolute URL solved the problem.