The name of the plugin, for use in error messages and logs.
OptionalversionThe version of the plugin, for use in inter-plugin communication scenarios.
OptionaloutputReplaces or manipulates the output options object passed to RolldownBuild.generate | bundle.generate() or RolldownBuild.write | bundle.write().
Returning null does not replace anything.
If you just need to read the output options, it is recommended to use
the renderStart hook as this hook has access to the output options
after the transformations from all outputOptions hooks have been taken into account.
OptionalaugmentCan be used to augment the hash of individual chunks. Called for each Rolldown output chunk.
Returning a falsy value will not modify the hash. Truthy values will be used as an additional source for hash calculation.
OptionalbannerA hook equivalent to output.banner option.
OptionalfooterA hook equivalent to output.footer option.
OptionalgenerateCalled at the end of RolldownBuild.generate | bundle.generate() or immediately before the files are written in RolldownBuild.write | bundle.write().
To modify the files after they have been written, use the writeBundle hook.
OptionalintroA hook equivalent to output.intro option.
OptionaloutroA hook equivalent to output.outro option.
OptionalrenderCan be used to transform individual chunks. Called for each Rolldown output chunk file.
Returning null will apply no transformations. If you change code in this hook and want to support source maps, you need to return a map describing your changes, see Source Code Transformations section.
chunk is mutable and changes applied in this hook will propagate to other plugins and
to the generated bundle.
That means if you add or remove imports or exports in this hook, you should update
imports, RenderedChunk.importedBindings | importedBindings and/or exports accordingly.
OptionalrenderCalled when Rolldown encounters an error during RolldownBuild.generate | bundle.generate() or RolldownBuild.write | bundle.write().
To get notified when generation completes successfully, use the
generateBundle hook.
OptionalrenderCalled initially each time RolldownBuild.generate | bundle.generate() or RolldownBuild.write | bundle.write() is called.
To get notified when generation has completed, use the generateBundle and
renderError hooks.
This is the recommended hook to use when you need access to the output options passed to RolldownBuild.generate | bundle.generate() or RolldownBuild.write | bundle.write() as it takes the transformations by all outputOptions hooks into account and also contains the right default values for unset options.
It also receives the input options passed to rolldown | rolldown() so that plugins that can be used as output plugins, i.e. plugins that only use generate phase hooks, can get access to them.
OptionalwriteCalled only at the end of RolldownBuild.write | bundle.write() once all files have been written.
Make all properties in T optional