/// import childProcess from 'node:child_process'; import { ResolvedConfig } from 'vite'; import { IPluginConfig } from "../helpers/plugin-config.js"; interface IBuildParams { mode: string; onFinish?: () => void; clientOptions?: string; serverOptions?: string; focusOnly?: 'all' | 'app' | 'client' | 'server' | 'entrypoint'; isWatch?: boolean; isUnlockRobots?: boolean; isEject?: boolean; isServerless?: boolean; isNoWarnings?: boolean; } interface IBuildProcess { promise: Promise; command: childProcess.ChildProcess; } interface ISpawnBuildParams { shouldWait?: boolean; focusOnly?: IBuildParams['focusOnly']; env?: Record; } interface IBuildEntrypoint { name: string; type: 'spa' | 'ssr'; indexFile?: string; clientFile?: string; serverFile?: string; buildOptions?: string; } /** * Build service */ declare class Build { /** * Is production build */ protected isProd: boolean; /** * Node environment */ protected nodeEnv: string; /** * Build folder */ protected buildDir: string; /** * Vite config */ protected viteConfig: ResolvedConfig; /** * Plugin config */ protected pluginConfig: IPluginConfig; /** * Build params */ protected params: IBuildParams; /** * Abort controller for builds */ protected abortController: AbortController | null; /** * Running builds */ protected runningBuild: { name: string; buildProcess: IBuildProcess; }[]; /** * Listener for preview has attached */ protected hasPreviewModeExitListener: boolean; /** * @constructor */ /** * @constructor */ constructor(params: IBuildParams); /** * Make config */ /** * Make config */ protected makeConfig(): Promise; /** * Clear build folder */ /** * Clear build folder */ clearBuildFolder(): void; /** * Return is prod indicator value */ /** * Return is prod indicator value */ getIsProd(): boolean; /** * Return node env value */ /** * Return node env value */ getNodeEnv(): string; /** * Return build names */ /** * Return build names */ getRunningBuildNames(): string[]; /** * Promisify spawn process */ /** * Promisify spawn process */ protected promisifyProcess(command: childProcess.ChildProcess, isRejectWarnings?: boolean): IBuildProcess; /** * Build assets manifest file */ /** * Build assets manifest file */ protected buildManifest(): void; /** * Change general directive Disallow to Allow in robots.txt. */ /** * Change general directive Disallow to Allow in robots.txt. */ protected unlockRobots(): void; /** * Eject cli to run app via node */ /** * Eject cli to run app via node */ protected eject(): void; /** * Create serverless entrypoint */ /** * Create serverless entrypoint */ protected createServerless(): void; /** * Build specified entrypoint */ /** * Build specified entrypoint */ protected spawnBuild(name: string, buildOptions: string, params?: ISpawnBuildParams): Promise; /** * Wait latest build and stop process in case error */ /** * Wait latest build and stop process in case error */ protected waitLastBuild(): Promise; /** * Run preview mode */ /** * Run preview mode */ protected runPreviewMode(): void; /** * Run app build */ /** * Run app build */ build(): Promise; } export { Build as default, IBuildParams, IBuildEntrypoint };