I am building a Single SPA application and am facing problems toward deployment. I am deploying each app inside a subdirectory (app-bar-mf, products-mf, and so on), and root-config (the main application) at base.
When working locally, each app is served through it's own server (localhost:9000, localhost:9001, and so on) so no subdirectories here.
When I am trying to deploy, the publicPath is not used, and assets are served through "/img/foo.png" instead of "/products-mf/img/foo.png".
If I set __webpack_public_path__
in my main.js, everything works as expected.
Any clues ?
vue.config.js
module.exports = {
publicPath: process.env.NODE_ENV === "production" ? "/products-mf/" : "/",
configureWebpack: () => {
const conf = {
externals: [
"vue",
"vuex",
"vue-router",
"vue-i18n"
]
};
if (process.env.NODE_ENV === "production") {
conf.output = { "products.js" };
}
return conf;
},
filenameHashing: false,
transpileDependencies: ["vuetify"]
};