Skip to content

How to extend the vite config? #388

Discussion options

You must be logged in to vote

Thanks for the kind words.

Theoretically, a vite.config.ts in the root folder will just get "picked up". And with some black magic, vite itself merges it with the "mandatory" vite configuration.

I imagine if you tweak the config too much things would break. I'm not 100% sure how the merging is done, but it's done automatically.

But that's the behavior I observed when developing it.

Also look at https://vite.dev/guide/api-javascript#mergeconfig

Start small, maybe try enabling an additional plugin and ensure the plugin is getting appended to the existing ones rather than replacing.

For reference, there's two sets of config: for dev and for production.

https://github.com/silviogutierrez/reac…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@viktorvillalobos
Comment options

@viktorvillalobos
Comment options

@silviogutierrez
Comment options

Answer selected by viktorvillalobos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants