Closed mantaroh closed 1 year ago
This Hook API is inspired from Astro API This API allows to hook each step of build. For example:
Hook API
If we provide injection of some static file after building, this API might be helpful.
This API help for third-party developer who developing plugins:
We provide hook API function type.
export interface HookApi { configuration?: ConfigurationHookFunction, beforeBuild?: BeforeBuildHookFunction, afterBuild? : AfterBuildHookFunction, bundle? : BundleHookFunction, }
User specify this hook function into spear.config.js .
spear.config.js
sample: spear.config.mjs
import { hookSample } from "./hook-sample.js" { "plugins": [ hookSample, ] }
https://github.com/unimal-jp/spear-doc/issues/4
What is this?
This
Hook API
is inspired from Astro APIThis API allows to hook each step of build.
For example:
If we provide injection of some static file after building, this API might be helpful.
Why do we need this API?
This API help for third-party developer who developing plugins:
Specifications
Way to inject hook API
We provide hook API function type.
User specify this hook function into
spear.config.js
.sample: spear.config.mjs