Skip to content

Respect configured assetsDir for all assets #13173

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

Closed
wants to merge 2 commits into from

Conversation

danieltroger
Copy link

Since upgrading to the latest stable version of react-router we saw some output assets no longer being in build/client/lite, what we have configured in vite.config.ts, but instead in build/client/assets, for example MultiStoreBoundary of the ones shown below.

Due to reasons all client assets must be in a folder called lite in our setup or they won't be accessible, so upgrading react-router brought down our app, in the condition that one entered it on a route that needed the files that were suddenly in assets (additional to only happening in prod due to complicated reverse proxy setup but not dev when testing).

This fixes the issue, by changing the hardcoded assets folder in the react-router vite plugin to instead respect the build.assetDir from the users' vite.config.ts file.

bild

build/client/lite/TabMenuHorizontal-Cj00gGiI.js                          1.93 kB │ gzip:   0.94 kB │ map:     5.79 kB
build/client/lite/LazySpline-CuWQDOoW.js                                 1.98 kB │ gzip:   1.02 kB │ map:     5.29 kB
build/client/lite/CompactButton-DG38KrCW.js                              2.05 kB │ gzip:   0.85 kB │ map:     5.14 kB
build/client/lite/Banner-CFLqHPHd.js                                     2.16 kB │ gzip:   1.07 kB │ map:     6.05 kB
build/client/lite/List-CkfHjRHN.js                                       2.20 kB │ gzip:   0.80 kB │ map:     4.78 kB
build/client/lite/Copy-CvE0E__T.js                                       2.29 kB │ gzip:   0.87 kB │ map:     4.86 kB
build/client/assets/MultiStoreCollectionMappingView-Koj_yuKa.js          2.38 kB │ gzip:   0.97 kB │ map:     0.12 kB
build/client/lite/useMultiStore-BOJOA2nD.js                              2.38 kB │ gzip:   0.97 kB │ map:     8.17 kB
build/client/lite/CaretUpDown-DRnmhLNr.js                                2.56 kB │ gzip:   1.02 kB │ map:     5.16 kB
build/client/assets/MultiStoreBoundary-LW1DRoMB.js                       2.58 kB │ gzip:   1.16 kB │ map:     4.46 kB
build/client/lite/CheckCircle-Ch1UKKx0.js                                2.59 kB │ gzip:   0.98 kB │ map:     5.20 kB

Copy link

changeset-bot bot commented Mar 6, 2025

⚠️ No Changeset found

Latest commit: 77854d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Mar 6, 2025

Hi @danieltroger,

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 CLA Signed label will be added to the pull request.

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

@danieltroger
Copy link
Author

I would appreciate if react-router maintainers could take over this PR if any further changes need to be added.

Thank you!

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Mar 6, 2025

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

Copy link
Member

@markdalgleish markdalgleish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

This issue was already fixed in #13077 and released in v7.3.0.

If you're still having issues with this version, feel free to open another PR/issue.

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

Successfully merging this pull request may close these issues.

2 participants