reactjswebpackreact-ssr

Webpack code-splitting bundles hosted over two servers


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?


Solution

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