You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mergeConfig is documented to "Deeply merge two Vite configs" but it seems to stop at plugins. If you have two configs, each defining the same plugin with different options, instead of merging it and having one entry for the plugin, we get two, and resulting errors. See Stackblitz for example where two react plugin entries cause errors.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Plugins are not merged because it's not possible to merge it.
Two plugins could have same name but runs in different order (enforce).
Two plugins with the same names are acceptable as long as they don't overlap (e.g. the includes option is used to transform specific files only). In which case, Vite shouldn't merge them.
Two plugins may contain their own separate state in a closure, and it can't be combined.
Some plugins are not meant/accounted to be used multiple times. It shouldn't be used multiple times in the first place in that case.
Describe the bug
mergeConfig
is documented to "Deeply merge two Vite configs" but it seems to stop at plugins. If you have two configs, each defining the same plugin with different options, instead of merging it and having one entry for the plugin, we get two, and resulting errors. See Stackblitz for example where tworeact
plugin entries cause errors.Reproduction
https://stackblitz.com/edit/vitejs-vite-awhsbt?file=vite.config.ts
Steps to reproduce
stackblitz should show the errors right away. Look at vite.config.ts to see the
react(...)
plugin entries causing the problemsSystem Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: