Skip to content
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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baijunjie
Copy link

@baijunjie baijunjie commented Sep 20, 2024

…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?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

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

  • Read the Code of Conduct and follow the Commit Convention guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@baijunjie
Copy link
Author

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

@ruleeeer
Copy link
Collaborator

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

@baijunjie
Copy link
Author

baijunjie commented Oct 1, 2024

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

@stigzelm
Copy link

What is the hold up for this to get merged? I would really need this fix asap.

@baijunjie
Copy link
Author

@stigzelm Hi friend, I believe the author has abandoned maintaining this project. However, there seems to be a better alternative now: @module-federation/vite. That said, it has the same issue—failing to use the base configured in vite.config as the final path for the output. If you’re also hoping to see this issue fixed, please follow this issue: module-federation/vite#217.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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