I tried to get it done from the rspack.config.js but for some reasons that configuration was not passed to the “global” settings which were considered for building production.
I then used the official Rspack documentation, and that led me to success.
This didn’t work:
export default {
output: {
// this is the default value when `target` is `'web'` or `'webworker'`
publicPath: 'auto',
},
};
This worked:
__webpack_public_path__ = "your_cdn_url"
I already had a CDN serving my bundle files, so the final solution was literally 1 line of code. This line of code came after 3 hours of AI useless chatting :))). I would think I use the best tools for AI, the RouteLLM inside ChatLLM of Abacus.ai which selects the most “competent” AI provider depending on the nature of the conversation. These tools are moving too fast and make all LLMs pretty much useless. I learnt again that the official documentation is still the best source of information.
- I created a new file in /app/client.
- I added this to the file
__webpack_public_path__ = "your_cdn_url" - I imported the file at the top of /app/client/main.js


