remoteEntry.js file response is text/html error
pclokcer opened this issue · comments
Versions
- vite-plugin-federation: v1.3.4
- vite: v5.0.8
Reproduction
Additional Details
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import federation from "@originjs/vite-plugin-federation"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
isProduction: true
}),
federation({
name: 'host-app',
remotes: {
client1: 'http://localhost:5001/assets/remoteEntry.js',
client2: 'http://localhost:5002/assets/remoteEntry.js',
},
shared: ['vue']
})
],
build: {
target: 'esnext',
minify: false,
cssCodeSplit: true,
rollupOptions: {
output: {
minifyInternalExports: false
}
}
}
})
Steps to reproduce
What is Expected?
I am calling remote adress http://localhost:5001/assets/remoteEntry.js
and response is content-type text/html.
in fact expected js script file but coming text/html
What is actually happening?
we need to build project and run as preview mode.
https://github.com/originjs/vite-plugin-federation/blob/main/README.md#vite-dev-mode