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
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 https://github.com/vuejs/vue-next instead.
If a plugin adds another plugin via the config() hook, then the "inner" one will be ignored. Only the outer plugin will be added. My goal is to create a wrapper plugin for Preact applications that automatically sets up the prefresh plugin, devtools bridge and some custom SSR stuff.
Alright, after lots of experimentation and an attempt to add recursively registering plugins myself, I've come to the conclusion that this would open up a can of worms. It makes config creation a lot more complex and it's unclear in which order some hooks should be processed. Much easier if the plugin tree remains flat.
Instead I found another neat way to enable presets: mergeConfig(). With that we can just pass a config around and extend it:
functionwithPreset(config){returnmergeConfig(config,{plugins: [foo(),bar()]});// vite.config.tsexportdefaultwithPreset({// user config})
Describe the bug
If a plugin adds another plugin via the
config()
hook, then the "inner" one will be ignored. Only the outer plugin will be added. My goal is to create a wrapper plugin for Preact applications that automatically sets up the prefresh plugin, devtools bridge and some custom SSR stuff.Reproduction
Repro: https://github.com/marvinhagemeister/vite-nested-plugin-bug
npm install
npm start
and open the pageSystem Info
vite
version: 2.0.5The text was updated successfully, but these errors were encountered: