UNPKG

1.9 kBTypeScriptView Raw
1import './polyfills';
2import { Options, Config, NormalizedConfig, Format, ConfigEntryObject, ConfigOutput, RunContext, RollupConfig, Task } from './types';
3interface RunOptions {
4 write?: boolean;
5 watch?: boolean;
6 concurrent?: boolean;
7}
8interface RollupConfigInput {
9 source: {
10 input: string[] | ConfigEntryObject;
11 files: string[];
12 hasVue: boolean;
13 hasTs: boolean;
14 };
15 title: string;
16 format: Format;
17 context: RunContext;
18 assets: Assets;
19 config: NormalizedConfig;
20}
21export declare class Bundler {
22 options: Options;
23 rootDir: string;
24 config: NormalizedConfig;
25 configPath?: string;
26 pkg: {
27 path?: string;
28 data?: any;
29 };
30 bundles: Set<Assets>;
31 constructor(config: Config, options?: Options);
32 normalizeConfig(config: Config, userConfig: Config): Config & {
33 input: string | ConfigEntryObject | (string | ConfigEntryObject)[];
34 output: ConfigOutput;
35 plugins: {
36 [name: string]: any;
37 };
38 babel: {
39 asyncToPromises: boolean;
40 } & import("./types").BabelPresetOptions;
41 externals: (string | RegExp | ((id: string, parentId?: string | undefined) => boolean) | undefined)[];
42 };
43 createRollupConfig({ source, format, title, context, assets, config, }: RollupConfigInput): Promise<RollupConfig>;
44 run(options?: RunOptions): Promise<this>;
45 build(task: Task, context: RunContext, write?: boolean): Promise<void>;
46 handleError(err: any): void;
47 resolveRootDir(...args: string[]): string;
48 localRequire(name: string, { silent, cwd }?: {
49 silent?: boolean;
50 cwd?: string;
51 }): any;
52 getBundle(index: number): Assets;
53}
54interface Asset {
55 absolute: string;
56 source: string;
57}
58declare type Assets = Map<string, Asset>;
59export { Config, NormalizedConfig, Options, ConfigOutput };
60
\No newline at end of file