Template: header
Template: markdown

Build hooks

The BuilderPlugin allows you to run hooks before and after the build step. This may be useful for running tests, performing some sort of verification, or peforming general operations before and after the build.

The BuilderPlugin has access to the Builder object before the build step, and has access to a BuildResult object after the build step. The BuildResult object contains a diff, manifest, and metrics about the build.

Read BuildResult Referencelaunch

Example

export default (pod: Pod) => {
    const plugin = pod.plugins.get('BuilderPlugin') as BuilderPlugin;
 
plugin.addBeforeBuildStep(<span class="hljs-function"><span class="hljs-params">builder</span> =&gt;</span> {
<span class="hljs-comment">// Do something with the builder.</span>
});

plugin.addAfterBuildStep(<span class="hljs-function"><span class="hljs-params">buildResult</span> =&gt;</span> {
<span class="hljs-comment">// Do something with the build result.</span>
});

}

Template: footer