UNPKG

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