import { MaybeArray, MaybePromise } from '@fuman/utils'; import { PluginOption } from 'vite'; import { BuildHookContext } from '../config.js'; export declare function fumanBuild(params: { root: URL | string; /** * package root, will be passed to vite's `root` option * * @default `process.cwd()` */ packageRoot?: string; /** * files to copy from the workspace root directory to the build directory * * @default ['LICENSE'] */ copyRootFiles?: string[]; /** * files to copy from the package root directory to the build directory * * @default ['README.md'] */ copyPackageFiles?: string[]; /** * the modifiable part of the chunk file name * there will be a prefix of `chunks/[format]/` and a suffix of `.js` * @default `[hash]` */ chunkFileName?: string; /** * workspace dependencies that are bundled with the library, * and as such shouldn't present in the final package.json */ bundledWorkspaceDeps?: MaybeArray; rootFieldsToCopy?: string[]; /** when true, will automatically add `sideEffects: false` to generated package.json-s */ autoSideEffectsFalse?: boolean; /** * hook to run *before* anything is done to the package.json file * you **can** modify the .packageJson property of the context * * this hook is called before vite build has started, * and as such `.outDir` is not available yet * (note: this hook is run *before* package-level hooks) */ preparePackageJson?: (ctx: BuildHookContext) => void; /** * hook to run *after* the package.json file is finalized, * right before it is written to disk * you **can** modify the .packageJson property of the context * (note: this hook is run *before* package-level hooks) */ finalizePackageJson?: (ctx: BuildHookContext) => MaybePromise; /** * hook to run *after* the build is done, * time to do any final modifications to the package contents * (note: this hook is run *before* package-level hooks) */ finalize?: (ctx: BuildHookContext) => MaybePromise; /** * when using with `vite-plugin-dts`, use this flag instead of * their `insertTypesEntry` option to insert the types entry, * as their implementation doesn't always yield the correct result * * @default false */ insertTypesEntry?: boolean; /** * when using with `vite-plugin-dts`, this value should match `entryRoot` * value passed to the `vite-plugin-dts` plugin */ typesEntryRoot?: string; }): Promise;