@growing-web/esm-pack-core
Version:
esm pack build core.
42 lines (38 loc) • 1.65 kB
TypeScript
import { PackageJson } from 'pkg-types';
declare type Recordable = Record<string, any>;
declare function resolvePackage(cachePath: string): Promise<PackageJson>;
declare function resolveImports(pkg: Recordable): Promise<{
imports?: undefined;
} | {
imports: any;
}>;
declare function resolveExports(pkg: PackageJson, root: string): Promise<Recordable>;
declare function resolveFiles(pkg: PackageJson, root: string, pkgExports: Record<string, any>): Promise<string[]>;
declare function resolveDevFilename(filename: string): Promise<string>;
declare function isDynamicEntry(source: string): Promise<boolean>;
declare function normalizeExport(str: string): string;
declare function removeFileExt(file: string): string;
declare function build({ buildFiles, outputPath, sourcePath, sourcemap, }: {
buildFiles: string[];
outputPath: string;
sourcePath: string;
sourcemap?: boolean;
}): Promise<void>;
declare function doBuildMultipleEntry({ input, sourcePath, outputPath, env, name, sourcemap, }: {
input: Record<string, string>;
outputPath: string;
sourcePath: string;
env: string;
name?: string;
sourcemap: boolean;
}): Promise<void>;
declare function doBuildSingleEntry({ input, sourcePath, outputPath, env, name, sourcemap, devPrefix, }: {
input: string;
outputPath: string;
sourcePath: string;
env: string;
name?: string;
sourcemap: boolean;
devPrefix?: string;
}): Promise<void>;
export { build, doBuildMultipleEntry, doBuildSingleEntry, isDynamicEntry, normalizeExport, removeFileExt, resolveDevFilename, resolveExports, resolveFiles, resolveImports, resolvePackage };