Added more docs on events
This commit is contained in:
parent
bc60df6d26
commit
59a4ab50b9
|
@ -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.
|
|
@ -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.
|
|
@ -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()
|
||||||
|
```
|
Loading…
Reference in New Issue