originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.39k stars 241 forks source link

fix: The `remoteEntryChunk` should use the base path from the Vite co… #631

Open baijunjie opened 2 months ago

baijunjie commented 2 months ago

…nfig.

Fixes #629

Description

Under normal circumstances, the reference paths for resource files built by a plugin should align with the base path specified in the Vite config.

Additional context

The filename of the exposed remote module usually doesn't include a hash because it's the entry point for remote modules and needs to be accessible by external applications. Therefore, it is typically deployed separately on Nginx, while other resources are placed on a CDN. If a relative path is used, it can cause a bug where files can't be found.

What is the purpose of this pull request?

Before submitting the PR, please make sure you do the following

baijunjie commented 1 month ago

It seems that the CI didn't pass. Is there anything else you need me to do?

ruleeeer commented 1 month ago

It looks like the test fails, does it work locally for you? pnpm test

baijunjie commented 1 month ago

It looks like the test fails, does it work locally for you? pnpm test

These errors don’t seem related to my changes. I also couldn’t pass the tests when running pnpm test on the main branch.

image