vite icon indicating copy to clipboard operation
vite copied to clipboard

refactor: plugin container

Open antfu opened this issue 1 year ago • 4 comments

Redo #16740 against main.

  • PluginContext per-plugin, instead of per-hook, align with rollup: https://github.com/rollup/rollup/blob/1b62c336b8e927e846cd2c04563ae0868a5d5832/src/utils/PluginDriver.ts#L105-L110
    • resolveId, transform and load are per-hook, align with rollup as well
  • Hoisted Context and TransformContext classes to top-level instead of having them in the function that creates every time.
  • Make PluginContainer a class to have more explicit deps relationships and easier to work with

antfu avatar May 23 '24 13:05 antfu

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

/ecosystem-ci run

antfu avatar May 23 '24 14:05 antfu

Awesome! If we want to merge this one before v6, let's do it in 5.3

patak-dev avatar May 23 '24 15:05 patak-dev