How to make the size in remotes of vite.configure.js update automatically?

28 Views Asked by At

This is my vite.configure.js, every time I make a change to my remote services, I have to update the URIs in remotes. I want this part of the code update automatically.

 import { defineConfig } from 'vite'
 import react from '@vitejs/plugin-react'
 import federation from "@originjs/vite-plugin-federation";
 export default defineConfig({

   plugins: [
      react(),
      federation({
      name: 'host-app',
        remotes: {
          remoteApp: "http://localhost:5001/assets/remoteEntry.js",
          remoteAppTwo: "http://localhost:5002/assets/remoteEntry.js",
         remoteAppThree: "http://localhost:5003/assets/remoteEntry.js",
         remoteAppFour: "http://localhost:5004/assets/remoteEntry.js",
       },
        shared: ['react','react-dom'] 
     })
 ],
})

For example, if I add remoteAppFive, I do not have to revise the configuration by myself.

remotes: {
   
},
0

There are 0 best solutions below