LogoRobo.js
Framework

BuildTransformContext

Interface: BuildTransformContext

Context provided to build/transform.ts hooks. Runs AFTER entries are processed but BEFORE manifest generation. Allows filtering and transforming processed entries.

Hook signature: (entries: ProcessedEntry[], context: BuildTransformContext) => ProcessedEntry[]

The entries are passed as the first argument for modification. The context also provides entries accessor for convenience (read-only inspection).

Example

export default function (entries: ProcessedEntry[], context: BuildTransformContext) {
  // Use context.entries for read-only inspection
  const commands = context.entries?.get('discordjs', 'commands') ?? []
  context.logger.info(`Processing ${commands.length} commands`)

  // Filter/transform and return modified entries
  return entries.filter(e => !e.key.startsWith('debug'))
}

Extends

Properties

PropertyTypeDescriptionOverridesInherited from
configConfigLoaded configuration-BuildContext.config
entriesEntriesAccessorEntries accessor is always available in transform hooksBuildContext.entries-
envtypeof EnvEnvironment variable access-BuildContext.env
loggerLoggerLogger instance (forked for plugins)-BuildContext.logger
modestringCurrent build mode (supports custom modes like 'beta', 'staging', etc.)-BuildContext.mode
paths{ output: string; root: string; src: string; }Project paths-BuildContext.paths
paths.outputstring---
paths.rootstring---
paths.srcstring---
storeBuildStoreKey-value store for passing data between build hooks. Use to share computed values between build/start and build/complete.-BuildContext.store

On this page