Star

MIT License
Copyright © 2020
CONNECT-platform

linkBuild Hooks

The afterBuild config allows you to add functions (called hooks) that will be invoked after the build process is finished:

1import { configuration } from '@codedoc/core';

2

3//...

4

5export const config = /*#__PURE__*/configuration({

6 //...

7 afterBuild: [

8 function logFinished() {

9 console.log('Build Finished!!!!');

10 }

11 ],

12 //...

13});


touch_app NOTE

It is highly recommended to use named functions (and not arrow functions) as hooks. CODEDOC will log the name of each hook it is running, so providing a name makes it easy to track and debug hooks.


linkAsync Hooks

An after-build hook can also be asynchronous.CODEDOC will wait for each hook to finish before it executes the next hook (or deems the build process complete).


linkBuild Object

Each after-build hook will also be passed a Build object, which contains information about the build that just concluded:

1import { configuration, Build, CodedocConfig } from '@codedoc/core';

2

3//...

4

5export const config = /*#__PURE__*/configuration({

6 //...

7 afterBuild: [

8 async function hook(build: Build<CodedocConfig>) {

9 ...

10 }

11 ],

12 //...

13});

Any Build object has the following properties:

Build HooksAsync HooksBuild Object

Home Overview CLI Theme

Markdownchevron_right
Code Featureschevron_right

Images & Assets

Configurationchevron_right
Customizationchevron_right