Im trying to publish locally a webpack on Vite to test micro front ends, but when I run my host app, it doesn't find the remoteEntry.js, and thats because when I try to access my remoteEntry.js, it doesn't exist. Does anyone know why?
This is my vite.conf on the remote
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
// vite.config.js
import federation from "@originjs/vite-plugin-federation";
export default defineConfig({
server: {
port: 8080,
},
plugins: [
vue(),
federation({
name: "myLib",
filename: "remoteEntry.js",
// Modules to expose
exposes: {
"./Counter": "./src/components/Counter.vue",
},
remotes: {},
shared: ["vue"],
}),
],
});
And this is the config on the remote side:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import federation from "@originjs/vite-plugin-federation";
export default defineConfig({
server: {
port: 8081,
},
plugins: [
vue(),
federation({
name: "myApp",
remotes: {
myLib: "http://localhost:8080/assets/remoteEntry.js",
},
shared: ["vue"],
}),
],
});
When i try to access my dependencies on the host side, this error pops on the console:
Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://localhost:8080/assets/remoteEntry.js
Thank you very much