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:

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

2link

3link//...

4link

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

6link //...

7link afterBuild: [

8link function logFinished() {

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

10link }

11link ],

12link //...

13link});


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:

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

2link

3link//...

4link

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

6link //...

7link afterBuild: [

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

9link ...

10link }

11link ],

12link //...

13link});

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