Try to use @originjs/vite-plugin-federation in tanstack-start application, but it throw an error while importing remote component like "Error in renderToPipeableStream: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'http:'". But if i do it using defineConfig from vite, everything works fine
This is my tanstack-start config
import { defineConfig } from '@tanstack/react-start/config';
import tsConfigPaths from 'vite-tsconfig-paths';
import federation from "@originjs/vite-plugin-federation";
export default defineConfig({
vite: {
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
federation({
name: "host-app",
remotes: {
todo_components: "http://localhost:4173/assets/remoteEntry.js",
},
shared: ["react"],
}),
],
build: {
modulePreload: true,
target: "ES2022",
minify: false,
cssCodeSplit: false,
},
},
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744733293a4590591.html
评论列表(0条)