Configurable react-router.config.ts file location #14846
Closed
AaronBeaudoin
started this conversation in
Proposals
Replies: 1 comment
-
|
Just realized I'm dumb and there is a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just starting a new react-router project as new user and one annoying thing standing out to me is that my project root directory is a config soup. Fortunately, most of the files (
mise.toml,vite.config.ts,tsconfig.some-extended-config.json,wrangler.json,worker-configuration.d.ts) can be relocated to some.config/directory or elsewhere if I want to with some special setup and CLI args. However,react-router.config.tsstands out as pretty much the single major exception. This problem brings to mind #13268, which is somewhat similar. React Router seems to have quite a few files with hard coded paths/names that cannot be changed. I understand the spirit of simplicity and I wholeheartedly embrace it, but in this case it's just causing unnecessary clutter in my humble opinion.Another solution here would be to allow me to pass config settings as CLI args or perhaps environment variables.
As I dug around I found that the situation used to be better but was changed. I understand the justification for removing config from
vite.config.ts, but it seems really stupid when you only are needing the config to set a single future flag. Here's mine:Man, I really wish I could just delete this file, but I can't because the
v8_viteEnvironmentApiis necessary for Cloudflare's template because they depend heavily on the Vite Environment API so that they can integrate all their environment specific APIs.TLDR: I love the goal of simplicity, but this is a case where I think it's gone a little bit too far, and a tiny bit of extra flexibility to provide configuration different ways would help a lot, especially when I only want to set one or two options.
Beta Was this translation helpful? Give feedback.
All reactions