Skip to main content

Build

Helper functions for build scripts.

Functions

checkCompiledOutputInRepo()

function checkCompiledOutputInRepo(): Promise<void>;

Defined in: functions/build.ts:22

Helper function to see if the compiled output that is checked-in to the Git repository is up-to-date.

Note that compiled output (in e.g. the "dist" directory) is not usually committed to a Git repository, but this is necessary in certain cases, such as when writing a custom GitHub Action in TypeScript. In these situations, this function should be run as part of the linting stage in order to ensure that the compiled output is always up to date.

Returns

Promise<void>


compileToSingleFileWithBun()

function compileToSingleFileWithBun(packageRoot?, verbose?): Promise<void>;

Defined in: functions/build.ts:51

Helper function to compile a TypeScript project to a single file using Bun.

This function invokes bun build with the following flags:

  • --compile
  • --target=bun-linux-x64
  • --minify
  • --sourcemap
  • --outfile=[name]

This function assumes that the entrypoint is located at "./src/main.ts".

Parameters

ParameterTypeDefault valueDescription
packageRoot?stringundefinedOptional. The path to the root of the package. If not specified, it will be automatically determined based on the file path of the calling function.
verbose?booleanfalseOptional. Shows all of the stack frames. Default is false.

Returns

Promise<void>

See

https://bun.sh/docs/bundler/executables