File size: 1,265 Bytes
16533c4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | import { Options } from "@swc/types";
export type BundleInput = BundleOptions | BundleOptions[];
export declare const isLocalFile: RegExp;
export declare function compileBundleOptions(config: BundleInput | string | undefined): Promise<BundleInput>;
/**
* Usage: In `spack.config.js` / `spack.config.ts`, you can utilize type annotations (to get autocompletions) like
*
* ```ts
* import { config } from '@swc/core/spack';
*
* export default config({
* name: 'web',
* });
* ```
*
*
*
*/
export declare function config(c: BundleInput): BundleInput;
export interface BundleOptions extends SpackConfig {
workingDir?: string;
}
/**
* `spack.config,js`
*/
export interface SpackConfig {
/**
* @default process.env.NODE_ENV
*/
mode?: Mode;
target?: Target;
entry: EntryConfig;
output: OutputConfig;
module: ModuleConfig;
options?: Options;
/**
* Modules to exclude from bundle.
*/
externalModules?: string[];
}
export interface OutputConfig {
name: string;
path: string;
}
export interface ModuleConfig {
}
export type Mode = "production" | "development" | "none";
export type Target = "browser" | "node";
export type EntryConfig = string | string[] | {
[name: string]: string;
};
|