interface CustomBuildConfigObject {
    finalize?: (ctx: BuildHookContext) => MaybePromise<void>;
    finalizePackageJson?: (ctx: BuildHookContext) => MaybePromise<void>;
    jsr?: JsrConfig;
    pluginsPost?: Plugin<any>[];
    pluginsPre?: Plugin<any>[];
    preparePackageJson?: (ctx: BuildHookContext) => void;
    shouldCopyEntrypoint?: (name: string, target: string) => boolean;
    typedoc?:
        | Partial<TypeDocOptions>
        | (current: Partial<TypeDocOptions>) => Partial<TypeDocOptions>;
    viteConfig?: UserConfig;
}

Properties

finalize?: (ctx: BuildHookContext) => MaybePromise<void>

hook to run after the build is done, time to do any final modifications to the package contents

finalizePackageJson?: (ctx: BuildHookContext) => MaybePromise<void>

hook to run after the package.json file is finalized, right before it is written to disk you can modify the .packageJson property of the context

jsr?: JsrConfig

jsr-specific configuration

pluginsPost?: Plugin<any>[]

any additional vite plugins to be added after the fuman-build plugin

pluginsPre?: Plugin<any>[]

any additional vite plugins to be added before the fuman-build plugin

preparePackageJson?: (ctx: BuildHookContext) => void

hook to run before anything is done to the package.json file you can modify the .packageJson property of the context

this hook is called before vite build has started, and as such .outDir is not available yet

shouldCopyEntrypoint?: (name: string, target: string) => boolean

a predicate to determine if the entrypoint should be copied to the target directory as-is, without being processed by vite

  • name is the name of the entrypoint (e.g. ./foo.json)
  • target is the target path (e.g. ./src/foo.json)

the default implementation skips any non-javascript entrypoints, which is particularly useful for json and wasm files

(name, target) => !!target.match(/(?<!\.d)\.([mc]?[jt]sx?)$/i)
typedoc?:
    | Partial<TypeDocOptions>
    | (current: Partial<TypeDocOptions>) => Partial<TypeDocOptions>

package-specific configuration for typedoc

viteConfig?: UserConfig

vite config to be merged into the base config