-
I'm migrating a CRA app to RR 7 framework mode, and I'm stuck on getting the static files served correctly for the production build. I'm deploying the app to a server where there are many other apps hosted as well, so the static assets cannot live directly under just "/assets/" on the root. I have this in my react-router.config.ts:
And I have this in my vite.config.ts:
I have also tried setting "base" to something more explicit, like:
or ideally I would like since that is where it is hosted today:
But no matter what I do, the landing page markup of the page contains static urls like this:
Meaning its trying to load static files directly from the root of the site. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Note: |
Beta Was this translation helpful? Give feedback.
-
I'm no expert but does it work to update your vite config file?
|
Beta Was this translation helpful? Give feedback.
-
Remix had a "publicPath" option, but that doesn't seem to exist in the React Router config? https://remix.run/docs/en/main/file-conventions/remix-config#publicpath |
Beta Was this translation helpful? Give feedback.
-
My bad, I had the "base" option under build, seems it needs to be on the top level. This works:
|
Beta Was this translation helpful? Give feedback.
My bad, I had the "base" option under build, seems it needs to be on the top level.
This works: