-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
fix: support Vite plugins adding a server entry #14351
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @brillout, Welcome, and thank you for contributing to React Router! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Can you open an issue with a minimal reproduction that we can use to see the issue and validate the fix? Or, if it's possible to write a small E2E test with a vite plugin that demonstrates this issue that's even better - but if that's tricky or it needs to pull in a third party, let's just open an issue with a repro instead of pulling a third party into the E2E test. |
Bug report: #14352 |
I ain't sure how to easily reproduce this without adding a Telefunc dependency to React Router's monorepo. |
output: { | ||
entryFileNames: serverBuildFile, | ||
entryFileNames({ name }) { | ||
return name === "virtual_react-router/server-build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For onlookers: our server build virtual module (virtual:react-router/server-build
) gets sanitized via Rollup's sanitizeFilename which replaces the :
with _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some tests are failing because the name
ends up being server-build
rather than virtual_react-router/server-build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brillout was virtual_react-router/server-build
working for you? I just changed it to server-build
and now most tests are passing for me locally. Trying to figure out when we should expect virtual_react-router/server-build
vs just `server-build.
return name === "virtual_react-router/server-build" | |
return name === "server-build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in the reproduction I linked to, the name is virtual_react-router/server-build
. Maybe name === "server-build" || name === "virtual_react-router/server-build"
or name.endsWith("server-build")
then?
Btw. I guess this change should also be applied to other entryFileNames
usage. I just did the minimal amount of changes to fix the reproduction. (I'm inclined to think it's better the React Router team takes over the PR.)
🥳 I would love to be able to supply entry files (and event |
Add support for Vite plugins that add a server build entry. For example, this change is required for being able to use React Router with Telefunc.