diff --git a/content/docs/api/plugins/events/after-build-all/contents.lr b/content/docs/api/plugins/events/after-build-all/contents.lr new file mode 100644 index 00000000..bd91912e --- /dev/null +++ b/content/docs/api/plugins/events/after-build-all/contents.lr @@ -0,0 +1,12 @@ +title: after-build-all +--- +signature: builder +--- +summary: This event is emitted after all sources are built. +--- +type: event +--- +body: + +This event is emitted after the builder build all sources. It works similar +to the [before-build-all :ref](../before-build-all/) event otherwise. diff --git a/content/docs/api/plugins/events/after-build/contents.lr b/content/docs/api/plugins/events/after-build/contents.lr new file mode 100644 index 00000000..1e14f3e9 --- /dev/null +++ b/content/docs/api/plugins/events/after-build/contents.lr @@ -0,0 +1,13 @@ +title: after-build +--- +signature: builder, build_state, source, prog +--- +summary: This event is emitted after an individual source is built. +--- +type: event +--- +body: + +This event is emitted right after a source is being built into a final build +artifact. It works pretty much exactly the same as the [before-build +:ref](../before-build/) event. diff --git a/content/docs/api/plugins/events/before-build-all/contents.lr b/content/docs/api/plugins/events/before-build-all/contents.lr new file mode 100644 index 00000000..16b0cb1b --- /dev/null +++ b/content/docs/api/plugins/events/before-build-all/contents.lr @@ -0,0 +1,27 @@ +title: before-build-all +--- +signature: builder +--- +summary: This event is emitted before all sources are built. +--- +type: event +--- +body: + +This event is emitted before the builder decides to build all sources. It's +most useful for preprocessing sources on the file system before the rest of +the build process should pick it up. For instance here a plugin could inject +additional files into the asset folder and similar things. + +As an example, this is what the [Webpack Support +:ref](../../../../guides/webpack/) uses. + +## Example + +```python +import subprocess + +def on_before_build_all(self, builder, **extra): + root = ospath.join(self.env.root_path, 'webpack') + subprocess.Popen(['webpack'], cwd=root).wait() +```