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
Is your feature request related to a problem? Please describe.
The beforeBuild and afterBuild events allow site and plugin authors to perform custom tasks before or after the build. However, they need to be passed some information on the build progress and configuration. In particular, if I want to perform some post-processing on the site output, the afterBuild event handler needs to know the output directory. This is trivial in a site configuration file, but not in a plugin configuration file. Currently, a plugin would need to get that information directly from the site using it:
Eleventy should pass any information it has on the completed build (for afterBuild) or the pending build (for beforeBuild) as well as the configuration to event handlers to enable a wide range of use cases. I don't know how much data is available internally and how much can be exposed at those points in the lifecycle, but passing as much data as possible would be beneficial to allow plugins to perform whatever tasks they want. The most important information, at least for my use case, would be the input and output directories, as specified with the dir key.
Describe alternatives you've considered
Maybe eleventy could just pass the elventyConfig to the event handler instead of a custom data object? Though the documentation currently doesn't list a way to get configuration options like the dir options back, only how to set them. So if this approach is possible, it should be documented how to access this configuration through the eleventyConfig API.
Is your feature request related to a problem? Please describe.
The
beforeBuild
andafterBuild
events allow site and plugin authors to perform custom tasks before or after the build. However, they need to be passed some information on the build progress and configuration. In particular, if I want to perform some post-processing on the site output, theafterBuild
event handler needs to know the output directory. This is trivial in a site configuration file, but not in a plugin configuration file. Currently, a plugin would need to get that information directly from the site using it:Describe the solution you'd like
Eleventy should pass any information it has on the completed build (for
afterBuild
) or the pending build (forbeforeBuild
) as well as the configuration to event handlers to enable a wide range of use cases. I don't know how much data is available internally and how much can be exposed at those points in the lifecycle, but passing as much data as possible would be beneficial to allow plugins to perform whatever tasks they want. The most important information, at least for my use case, would be the input and output directories, as specified with thedir
key.Describe alternatives you've considered
Maybe eleventy could just pass the elventyConfig to the event handler instead of a custom data object? Though the documentation currently doesn't list a way to get configuration options like the
dir
options back, only how to set them. So if this approach is possible, it should be documented how to access this configuration through the eleventyConfig API.Additional context
This is a follow-up to #1143 and #729
The text was updated successfully, but these errors were encountered: