Skip to content

Custom remote entry file name not getting set in mf-manifest.json #226

Open
@DeveshSapkale

Description

@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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions