Skip to content

Plugins cannot add other plugins in config() hook #2484

@marvinhagemeister

Description

@marvinhagemeister

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

  1. Clone the repo above
  2. Run npm install
  3. Run npm start and open the page
  4. Page should render "It works!"

System Info

  • vite version: 2.0.5
  • Operating System: MacOS Big Sur
  • Node version: 15.10.0
  • Package manager (npm/yarn/pnpm) and version: npm 7.6.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions