import type { EsbuildPluginOptions } from 'bob-esbuild-plugin'; import type { InputOptions, OutputOptions, Plugin } from 'rollup'; import type { TSCOptions } from '../tsc/types'; import type { PackageJSON } from './packageJson'; import type { ConfigOptions } from './rollup'; export declare type PickRequired = T & Required>; export interface ExternalsOptions { /** * Path/to/your/package.json file (or array of paths). * Defaults to all package.json files found in parent directories recursively. * Won't got outside of a git repository. */ packagePath?: string | string[]; /** Mark node built-in modules like `path`, `fs`... as external. Defaults to `true`. */ builtins?: boolean; /** Mark dependencies as external. Defaults to `false`. */ deps?: boolean; /** Mark devDependencies as external. Defaults to `true`. */ devDeps?: boolean; /** Mark peerDependencies as external. Defaults to `true`. */ peerDeps?: boolean; /** Mark optionalDependencies as external. Defaults to `true`. */ optDeps?: boolean; /** Force these deps in the list of externals, regardless of other settings. Defaults to `[]` */ include?: string | RegExp | (string | RegExp)[]; /** Exclude these deps from the list of externals, regardless of other settings. Defaults to `[]` */ exclude?: string | RegExp | (string | RegExp)[]; /** @deprecated Use `exclude` instead. */ except?: string | RegExp | (string | RegExp)[]; } export interface BobConfig extends Pick { tsc?: TSCOptions; /** * It defaults to bob-esbuild.config directory */ rootDir?: string; /** * @default "dist" */ distDir?: string; plugins?: Plugin[]; /** * Disable monorepo features and validations * * @default false */ singleBuild?: boolean; inputOptions?: InputOptions; outputOptions?: Omit; /** * If dynamic imports `await import("foo")` should be kept as `import` * and NOT be transpiled as `await Promise.resolve(require("foo"))` * * This is specially useful when is needed to import an `ES Module` from `CommonJS`, * for example, when an external package has `"type": "module"`. * * If an array of strings is specified, the dynamic imports are only kept * for those specified modules * * @default false */ keepDynamicImport?: boolean | string[] | ((moduleName: string) => boolean); /** * Skip automatic TSC build, make sure to manually call `bob-esbuild tsc` * * @default false */ skipAutoTSCBuild?: boolean; /** * Custom esbuild plugin options * * Set as `false` to not include esbuild plugin */ esbuildPluginOptions?: EsbuildPluginOptions | false; externalOptions?: ExternalsOptions; /** * Enabled debugging logs */ verbose?: boolean; /** * Manually rewrite package json and skip validation */ manualRewritePackageJson?: Record Promise | PackageJSON>; /** * Set configurations for specific packages */ packageConfigs?: Record>; /** * @default false */ useTsconfigPaths?: boolean; } export declare type ResolvedBobConfig = PickRequired; export interface CosmiConfigResult { filepath: string; config: ResolvedBobConfig; } export declare const globalConfig: Promise & { current?: CosmiConfigResult; };