Skip to content

Although the base path was set, after the build, the exposed module is still using a relative path. #629

@baijunjie

Description

@baijunjie

Versions

  • vite-plugin-federation: 1.3.6
  • vite: 5.2.9

Reproduction

vite.config.js

{
  base: 'https://cdn.example.com/static-assets',
  plugins: [
    federation({
      name: 'pages',
      filename: 'remote.js',
      exposes: {
        './preload': './src/preload',
      },
    })
  ],
}

After the build
remote.js

...
let n={"./preload":()=>(c("./__federation_expose_Preload-CX6HpEAp.js")
...

What is Expected?

After the build
remote.js

...
let n={"./preload":()=>(c("[.](https://cdn.example.com/static-assets/__federation_expose_Preload-CX6HpEAp.js")
...

I checked the documentation but couldn’t find an option related to setting the file access path for exposed modules. I’m not sure if this is a bug or if I missed some configuration?

Metadata

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