Back to Rolldown

Plugin Hooks Transform

packages/rolldown/src/plugin/docs/plugin-hooks-transform.md

1.1.4722 B
Original Source

::: warning Changing moduleType

When you change the type of the module by returning moduleType property, the module is not thrown back to the beginning of the plugin chain. This means the transform hooks of the plugins that already saw this module will not be called with the new moduleType. For this reason, it is recommended to place the plugins that change the moduleType at the beginning of the plugin list.

If you need to let all the plugins be called, you can create a virtual module with a different moduleType instead of changing the moduleType directly in the transform hook.

:::