UNPKG

@visulima/packem

Version:

A fast and modern bundler for Node.js and TypeScript.

54 lines (53 loc) 1.73 kB
import type { ConstructorOptions } from "@visulima/pail"; import type { BuildConfig, Environment, Mode } from "./types.d.cts"; /** * Configuration options for Packem bundler * * @interface PackemOptions * @extends {BuildConfig} */ export interface PackemOptions extends BuildConfig { /** * The environment to build for * Determines the build environment configuration * * @default "production" * @type {Environment} * @memberof PackemOptions */ environment?: Environment; /** * Logger configuration options * Used to customize the logging behavior and output format * * @type {ConstructorOptions<string, string>} * @memberof PackemOptions */ logger?: ConstructorOptions<string, string>; /** * The mode to run Packem in * Controls how the bundler processes and optimizes the code * * @default "build" * @type {Mode} * @memberof PackemOptions */ mode?: Mode; } /** * Runs the Packem bundler with the specified options * * @param rootDirectory - The root directory of the project to bundle * @param options - Configuration options for the bundler * @returns Promise that resolves with the build result * * @example * ```typescript * const result = await packem("./src", { * mode: "build", * environment: "production" * }); * ``` */ export declare const packem: (rootDirectory: string, options?: PackemOptions) => Promise<void>; export type { BuildContext, BuildContextBuildAssetAndChunk, BuildContextBuildEntry, BuildEntry, BuildHooks, BuildOptions, Environment, Mode, RollupBuildOptions, Runtime, TransformerName, TransformerFn, IsolatedDeclarationsTransformer, } from "./types.d.cts";