Why generate it instead of copying a blog post
Everyone configuring Vite for the first time ends up copying a config out of a blog post, and those snippets rot: they use `path.resolve(__dirname, …)` in an ESM-only config file, they pin a build target from three years ago, they split vendor chunks in a way that no longer matches how Vite emits shared code. The result runs, which is the problem — nobody notices the stale part until something breaks on a deploy.
So this page generates only what you tick, in a shape that matches how Vite is written today:
- Only what you asked for. Leave the proxy box empty and no empty `server.proxy` object is emitted; pick no preprocessor and the config has no `css` section. A generated file should read like a file a person wrote, not like a form dump — that is also what makes it reviewable in a pull request.
- The two things blog snippets get wrong. Aliases are emitted as `fileURLToPath(new URL("./src", import.meta.url))`, which works in a config that Vite loads as ESM, and define values go through `JSON.stringify` so a version string stays a string. Both are exactly where copy-pasted configs fail on someone else’s machine.
- Proxy rules from a list. Paste one line per backend path (or a full https://host/api URL and let it split) and the tool writes the `server.proxy` block, including the rewrite that strips the prefix and `ws: true` for WebSocket targets. It also flags the traps: a target with no scheme, a duplicate path, and `secure: false`, which disables certificate checking and belongs only in local development.
Nothing is uploaded and nothing is installed: this page only produces text, and the install command it prints is for you to run where you decide. Two honest limits — it does not know which Vite version you are on, so version-specific options are kept to the ones that have been stable for years, and it will not guess your router mode: it only notes that a `base` other than `/` has to be given to a history-mode router as well. For checking an existing config rather than writing a new one, that is a separate tool in this cluster.