'Single-SPA Vite Code Split with different domains not working

I am building a micro front-end using Vue 3, Typescript, and Vite and for this, I have a wrapper in single-spa, let's call it wrapper.product.com.

And I also have a micro front-end, let's call it A, so it is placed at a.product.com and it is built using code split. The problem is that A only works with referenced dependencies. Therefore, when A tries to get assets/somefile it tries to fetch from wrapper.product.com/assets/somefile.

I am also using the build.base in the vite.config.ts to mention the right domain, but it didn't work.

I know there is a possible solution using webpack (systemjs-webpack-interop) but is it possible with Vite?

Any ideas to fix this and have all dependencies of A being fetched from the A domain?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source