/** * Parser for `tekir build` flags. Built on `node:util`'s `parseArgs` * (stdlib, zero deps, also available in Bun) so we get the same flag * semantics as the rest of the Node ecosystem instead of a hand-rolled * scanner that breaks on edge cases like `--external -` or * `--define KEY="value with spaces"`. * * The only thing we add on top is the legacy bare `--sourcemap` form * (with no value) meaning `--sourcemap=linked`, kept for backwards * compatibility with earlier tekir versions. */ export type SourcemapMode = 'linked' | 'inline' | 'external' | 'none'; export type ModuleFormat = 'esm' | 'cjs' | 'iife'; export interface MinifyOptions { syntax: boolean; whitespace: boolean; identifiers: boolean; } export interface ParsedBuildArgs { compile: boolean; outdir?: string; outfile?: string; target: string; format?: ModuleFormat; minify: boolean | MinifyOptions; keepNames: boolean; sourcemap?: SourcemapMode; splitting: boolean; bytecode: boolean; noBundle: boolean; externals: string[]; defines: Record; pluginPaths: string[]; drop: string[]; env?: string; publicPath?: string; banner?: string; footer?: string; entryNaming?: string; chunkNaming?: string; assetNaming?: string; metafileJson?: string; metafileMd?: string; execArgv?: string[]; autoloadTsconfig: boolean; autoloadPackageJson: boolean; autoloadDotenv: boolean; autoloadBunfig: boolean; keepArtifacts: boolean; unknown: string[]; } export declare class BuildArgsError extends Error { constructor(message: string); } export declare function parseBuildArgs(argv: string[]): ParsedBuildArgs;