Currently this plugin passes the webpackStats object directly to the render function.
This can be helpful when assets is not enough information to render.
However it can result in webpack specific logic being added to the render function. For example:
By adding a runtime transform function the logic required to pull data out of webpackStats object can be isolated to the webpack configuration.
This may be particularly useful for tools that wrap this plugin, which may choose to use the function to normalize the parameters being given to their consumer's render function.
'Render-time' build info
Separately, information required to render the HTML may not be available when the configuration is first built.
A render-time transform function will allow values created during the build process (such as peer webpack configurations) to be injected into the render process.
Isolating Webpack Logic
Currently this plugin passes the webpackStats object directly to the render function. This can be helpful when
assets
is not enough information to render.However it can result in webpack specific logic being added to the render function. For example:
By adding a runtime transform function the logic required to pull data out of webpackStats object can be isolated to the webpack configuration. This may be particularly useful for tools that wrap this plugin, which may choose to use the function to normalize the parameters being given to their consumer's render function.
'Render-time' build info
Separately, information required to render the HTML may not be available when the configuration is first built. A render-time transform function will allow values created during the build process (such as peer webpack configurations) to be injected into the render process.