-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom remote entry file name not getting set in mf-manifest.json #226
Comments
Hi @DeveshSapkale thanks for your feedback and investigation. |
@gioboa Do you mean I should create a PR for this fix. Or should handle it at my end which means simply using "remoteEntry.js" name? |
I really would like to give you the possibility to cover your needs. Is it possible with we pack/rspack? Because in the end we are using the core library under the hood |
Having custom name for remoteEntry file is possible with rspack's module federation plugin, it creates mf-manifest.json file properly, with given custom remote entry filename. |
Ok so let's try to implement it |
try |
@gioboa @zhangHongEn I agree that "test-remoteEntry.js" might work but I am using "test.remoteEntry.js" for my application as a convention "{remote name}.remoteEntry.js". |
I think the double dot can mess up things, that's my guess |
@gioboa
Issue:
When I use below configuration in federation plugin using vite remote from the example given in this repo
{
...
manifest: true
fileName: test.remoteEntry.js
....
}
The mf-manifest.json gets generated after vite build, but in
Manifest.json
{
.....
"remoteEntry ": {
"path": "",
"type: "module"
}
...
}
File name details in this manifest are empty for remoteEntry object.
This detail is only available when I keep name as remoteEntry.js
I debugged few line of code in the plugin repo and found that in file named "src/plugins/pluginMFManifest.ts"
Under generate bundle() function there is logic which sets "remoteEntryFile" variable which is then used to set the file name in mf-manifest.json file.
In this code we check if mfOptions.filename == fileData.name which is never true because mfOptions.filename will be a full name of "test.remoteEntry.js" with .js ext.
But fileData.name will be without js ext which is just "test.remoteEntry"
So from fix point of view I think condition should use fileData.preliminaryName instead of fileData.name.
But I am not aware of the usages and reason behind that code.
Are we aware of this issue or is there a specific way I need to provide the filename in federation plugin configuration.
I need to use custom name for it, that's a requirement.
The text was updated successfully, but these errors were encountered: