Skip to content

Commit

Permalink
fix: solve issue with filename !== remoteEntry (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeikim authored Feb 27, 2025
1 parent 8b399f7 commit be3d4d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/vite-webpack-rspack/host/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const mfConfig = {
name: 'host',
remotes: {
remote: {
entry: 'http://localhost:4001/remoteEntry.js',
entry: 'http://localhost:4001/custom-filename.js',
type: 'module',
},
webpack: {
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-webpack-rspack/remote/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
react(),
federation({
name: 'remote',
filename: 'remoteEntry.js',
filename: 'custom-filename.js',
// Modules to expose
exposes: {
'./Product': './src/Product.jsx',
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pluginMFManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const Manifest = (): Plugin[] => {
// 遍历打包生成的每个文件
for (const [fileName, fileData] of Object.entries(bundle)) {
if (
mfOptions.filename.replace(/[\[\]]/g, '_') === fileData.name ||
mfOptions.filename.replace(/[\[\]]/g, '_').replace(/\.[^/.]+$/, '') === fileData.name ||
fileData.name === 'remoteEntry'
) {
remoteEntryFile = fileData.fileName;
Expand Down

0 comments on commit be3d4d9

Please sign in to comment.