@doracli/esbuild 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,190 +1,123 @@
1
- import * as esbuild from 'esbuild';
2
- import { BuildOptions, BuildResult, ServeResult, WatchOptions, ServeOptions } from 'esbuild';
1
+ import type * as esbuild from 'esbuild';
2
+ import type {
3
+ BuildOptions,
4
+ BuildResult,
5
+ ServeOptions,
6
+ ServeResult,
7
+ WatchOptions,
8
+ } from 'esbuild';
3
9
  export { BuildOptions } from 'esbuild';
4
- import { CompilerBase, ConfigCtx } from '@doracli/helper';
5
- import { TCdn, TDoraConfig } from '@doracli/type';
10
+ import type { TOnionFun } from '@cclr/utils';
11
+ import type { ConfigCtx } from '@doracli/helper';
12
+ import { CompilerBase } from '@doracli/helper';
13
+ import type { TCdn, TDoraConfig } from '@doracli/type';
6
14
 
7
- declare const builder: (config: BuildOptions) => Promise<esbuild.BuildResult<BuildOptions>>;
15
+ declare const builder: (
16
+ config: BuildOptions
17
+ ) => Promise<esbuild.BuildResult<BuildOptions>>;
8
18
 
9
- declare class Compiler extends CompilerBase<BuildOptions, {
19
+ declare class Compiler extends CompilerBase<
20
+ BuildOptions,
21
+ {
10
22
  build: Promise<BuildResult<BuildOptions>>;
11
23
  watch: Promise<void>;
12
24
  server: Promise<ServeResult>;
13
- }> {
14
- constructor(config: Partial<BuildOptions>);
15
- inOutMap: (inputOutputMap: Record<string, string>) => Promise<BuildResult<{
16
- bundle?: boolean;
17
- splitting?: boolean;
18
- preserveSymlinks?: boolean;
19
- outfile?: string;
20
- metafile?: boolean;
21
- outdir?: string;
22
- outbase?: string;
23
- external?: string[];
24
- packages?: "bundle" | "external";
25
- alias?: Record<string, string>;
26
- loader?: {
27
- [ext: string]: esbuild.Loader;
28
- };
29
- resolveExtensions?: string[];
30
- mainFields?: string[];
31
- conditions?: string[];
32
- write?: boolean;
33
- allowOverwrite?: boolean;
34
- tsconfig?: string;
35
- outExtension?: {
36
- [ext: string]: string;
37
- };
38
- publicPath?: string;
39
- entryNames?: string;
40
- chunkNames?: string;
41
- assetNames?: string;
42
- inject?: string[];
43
- banner?: {
44
- [type: string]: string;
45
- };
46
- footer?: {
47
- [type: string]: string;
48
- };
49
- entryPoints?: (string | {
50
- in: string;
51
- out: string;
52
- })[] | Record<string, string>;
53
- stdin?: esbuild.StdinOptions;
54
- plugins?: esbuild.Plugin[];
55
- absWorkingDir?: string;
56
- nodePaths?: string[];
57
- sourcemap?: boolean | "linked" | "inline" | "external" | "both";
58
- legalComments?: "none" | "inline" | "eof" | "linked" | "external";
59
- sourceRoot?: string;
60
- sourcesContent?: boolean;
61
- format?: esbuild.Format;
62
- globalName?: string;
63
- target?: string | string[];
64
- supported?: Record<string, boolean>;
65
- platform?: esbuild.Platform;
66
- mangleProps?: RegExp;
67
- reserveProps?: RegExp;
68
- mangleQuoted?: boolean;
69
- mangleCache?: Record<string, string | false>;
70
- drop?: esbuild.Drop[];
71
- dropLabels?: string[];
72
- minify?: boolean;
73
- minifyWhitespace?: boolean;
74
- minifyIdentifiers?: boolean;
75
- minifySyntax?: boolean;
76
- lineLimit?: number;
77
- charset?: esbuild.Charset;
78
- treeShaking?: boolean;
79
- ignoreAnnotations?: boolean;
80
- jsx?: "transform" | "preserve" | "automatic";
81
- jsxFactory?: string;
82
- jsxFragment?: string;
83
- jsxImportSource?: string;
84
- jsxDev?: boolean;
85
- jsxSideEffects?: boolean;
86
- define?: {
87
- [key: string]: string;
88
- };
89
- pure?: string[];
90
- keepNames?: boolean;
91
- absPaths?: esbuild.AbsPaths[];
92
- color?: boolean;
93
- logLevel?: esbuild.LogLevel;
94
- logLimit?: number;
95
- logOverride?: Record<string, esbuild.LogLevel>;
96
- tsconfigRaw?: string | esbuild.TsconfigRaw;
97
- }>>;
98
- context: (opt: BuildOptions) => Promise<{
99
- rebuild: () => Promise<BuildResult<{
100
- bundle?: boolean;
101
- splitting?: boolean;
102
- preserveSymlinks?: boolean;
103
- outfile?: string;
104
- metafile?: boolean;
105
- outdir?: string;
106
- outbase?: string;
107
- external?: string[];
108
- packages?: "bundle" | "external";
109
- alias?: Record<string, string>;
110
- loader?: {
111
- [ext: string]: esbuild.Loader;
112
- };
113
- resolveExtensions?: string[];
114
- mainFields?: string[];
115
- conditions?: string[];
116
- write?: boolean;
117
- allowOverwrite?: boolean;
118
- tsconfig?: string;
119
- outExtension?: {
120
- [ext: string]: string;
121
- };
122
- publicPath?: string;
123
- entryNames?: string;
124
- chunkNames?: string;
125
- assetNames?: string;
126
- inject?: string[];
127
- banner?: {
128
- [type: string]: string;
129
- };
130
- footer?: {
131
- [type: string]: string;
132
- };
133
- entryPoints?: (string | {
25
+ }
26
+ > {
27
+ constructor(config: Partial<BuildOptions>);
28
+ inOutMap: (inputOutputMap: Record<string, string>) => Promise<
29
+ BuildResult<{
30
+ bundle?: boolean;
31
+ splitting?: boolean;
32
+ preserveSymlinks?: boolean;
33
+ outfile?: string;
34
+ metafile?: boolean;
35
+ outdir?: string;
36
+ outbase?: string;
37
+ external?: string[];
38
+ packages?: 'bundle' | 'external';
39
+ alias?: Record<string, string>;
40
+ loader?: {
41
+ [ext: string]: esbuild.Loader;
42
+ };
43
+ resolveExtensions?: string[];
44
+ mainFields?: string[];
45
+ conditions?: string[];
46
+ write?: boolean;
47
+ allowOverwrite?: boolean;
48
+ tsconfig?: string;
49
+ outExtension?: {
50
+ [ext: string]: string;
51
+ };
52
+ publicPath?: string;
53
+ entryNames?: string;
54
+ chunkNames?: string;
55
+ assetNames?: string;
56
+ inject?: string[];
57
+ banner?: {
58
+ [type: string]: string;
59
+ };
60
+ footer?: {
61
+ [type: string]: string;
62
+ };
63
+ entryPoints?:
64
+ | (
65
+ | string
66
+ | {
134
67
  in: string;
135
68
  out: string;
136
- })[] | Record<string, string>;
137
- stdin?: esbuild.StdinOptions;
138
- plugins?: esbuild.Plugin[];
139
- absWorkingDir?: string;
140
- nodePaths?: string[];
141
- sourcemap?: boolean | "linked" | "inline" | "external" | "both";
142
- legalComments?: "none" | "inline" | "eof" | "linked" | "external";
143
- sourceRoot?: string;
144
- sourcesContent?: boolean;
145
- format?: esbuild.Format;
146
- globalName?: string;
147
- target?: string | string[];
148
- supported?: Record<string, boolean>;
149
- platform?: esbuild.Platform;
150
- mangleProps?: RegExp;
151
- reserveProps?: RegExp;
152
- mangleQuoted?: boolean;
153
- mangleCache?: Record<string, string | false>;
154
- drop?: esbuild.Drop[];
155
- dropLabels?: string[];
156
- minify?: boolean;
157
- minifyWhitespace?: boolean;
158
- minifyIdentifiers?: boolean;
159
- minifySyntax?: boolean;
160
- lineLimit?: number;
161
- charset?: esbuild.Charset;
162
- treeShaking?: boolean;
163
- ignoreAnnotations?: boolean;
164
- jsx?: "transform" | "preserve" | "automatic";
165
- jsxFactory?: string;
166
- jsxFragment?: string;
167
- jsxImportSource?: string;
168
- jsxDev?: boolean;
169
- jsxSideEffects?: boolean;
170
- define?: {
171
- [key: string]: string;
172
- };
173
- pure?: string[];
174
- keepNames?: boolean;
175
- absPaths?: esbuild.AbsPaths[];
176
- color?: boolean;
177
- logLevel?: esbuild.LogLevel;
178
- logLimit?: number;
179
- logOverride?: Record<string, esbuild.LogLevel>;
180
- tsconfigRaw?: string | esbuild.TsconfigRaw;
181
- }>>;
182
- cancel: () => Promise<void>;
183
- }>;
184
- input: (input: string | string[]) => {
185
- output: (outputConfig: any) => Promise<BuildResult<BuildOptions>>;
186
- };
187
- build: (options: BuildOptions) => Promise<BuildResult<{
69
+ }
70
+ )[]
71
+ | Record<string, string>;
72
+ stdin?: esbuild.StdinOptions;
73
+ plugins?: esbuild.Plugin[];
74
+ absWorkingDir?: string;
75
+ nodePaths?: string[];
76
+ sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
77
+ legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
78
+ sourceRoot?: string;
79
+ sourcesContent?: boolean;
80
+ format?: esbuild.Format;
81
+ globalName?: string;
82
+ target?: string | string[];
83
+ supported?: Record<string, boolean>;
84
+ platform?: esbuild.Platform;
85
+ mangleProps?: RegExp;
86
+ reserveProps?: RegExp;
87
+ mangleQuoted?: boolean;
88
+ mangleCache?: Record<string, string | false>;
89
+ drop?: esbuild.Drop[];
90
+ dropLabels?: string[];
91
+ minify?: boolean;
92
+ minifyWhitespace?: boolean;
93
+ minifyIdentifiers?: boolean;
94
+ minifySyntax?: boolean;
95
+ lineLimit?: number;
96
+ charset?: esbuild.Charset;
97
+ treeShaking?: boolean;
98
+ ignoreAnnotations?: boolean;
99
+ jsx?: 'transform' | 'preserve' | 'automatic';
100
+ jsxFactory?: string;
101
+ jsxFragment?: string;
102
+ jsxImportSource?: string;
103
+ jsxDev?: boolean;
104
+ jsxSideEffects?: boolean;
105
+ define?: {
106
+ [key: string]: string;
107
+ };
108
+ pure?: string[];
109
+ keepNames?: boolean;
110
+ absPaths?: esbuild.AbsPaths[];
111
+ color?: boolean;
112
+ logLevel?: esbuild.LogLevel;
113
+ logLimit?: number;
114
+ logOverride?: Record<string, esbuild.LogLevel>;
115
+ tsconfigRaw?: string | esbuild.TsconfigRaw;
116
+ }>
117
+ >;
118
+ context: (opt: BuildOptions) => Promise<{
119
+ rebuild: () => Promise<
120
+ BuildResult<{
188
121
  bundle?: boolean;
189
122
  splitting?: boolean;
190
123
  preserveSymlinks?: boolean;
@@ -193,10 +126,10 @@ declare class Compiler extends CompilerBase<BuildOptions, {
193
126
  outdir?: string;
194
127
  outbase?: string;
195
128
  external?: string[];
196
- packages?: "bundle" | "external";
129
+ packages?: 'bundle' | 'external';
197
130
  alias?: Record<string, string>;
198
131
  loader?: {
199
- [ext: string]: esbuild.Loader;
132
+ [ext: string]: esbuild.Loader;
200
133
  };
201
134
  resolveExtensions?: string[];
202
135
  mainFields?: string[];
@@ -205,7 +138,7 @@ declare class Compiler extends CompilerBase<BuildOptions, {
205
138
  allowOverwrite?: boolean;
206
139
  tsconfig?: string;
207
140
  outExtension?: {
208
- [ext: string]: string;
141
+ [ext: string]: string;
209
142
  };
210
143
  publicPath?: string;
211
144
  entryNames?: string;
@@ -213,21 +146,26 @@ declare class Compiler extends CompilerBase<BuildOptions, {
213
146
  assetNames?: string;
214
147
  inject?: string[];
215
148
  banner?: {
216
- [type: string]: string;
149
+ [type: string]: string;
217
150
  };
218
151
  footer?: {
219
- [type: string]: string;
152
+ [type: string]: string;
220
153
  };
221
- entryPoints?: (string | {
222
- in: string;
223
- out: string;
224
- })[] | Record<string, string>;
154
+ entryPoints?:
155
+ | (
156
+ | string
157
+ | {
158
+ in: string;
159
+ out: string;
160
+ }
161
+ )[]
162
+ | Record<string, string>;
225
163
  stdin?: esbuild.StdinOptions;
226
164
  plugins?: esbuild.Plugin[];
227
165
  absWorkingDir?: string;
228
166
  nodePaths?: string[];
229
- sourcemap?: boolean | "linked" | "inline" | "external" | "both";
230
- legalComments?: "none" | "inline" | "eof" | "linked" | "external";
167
+ sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
168
+ legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
231
169
  sourceRoot?: string;
232
170
  sourcesContent?: boolean;
233
171
  format?: esbuild.Format;
@@ -249,14 +187,14 @@ declare class Compiler extends CompilerBase<BuildOptions, {
249
187
  charset?: esbuild.Charset;
250
188
  treeShaking?: boolean;
251
189
  ignoreAnnotations?: boolean;
252
- jsx?: "transform" | "preserve" | "automatic";
190
+ jsx?: 'transform' | 'preserve' | 'automatic';
253
191
  jsxFactory?: string;
254
192
  jsxFragment?: string;
255
193
  jsxImportSource?: string;
256
194
  jsxDev?: boolean;
257
195
  jsxSideEffects?: boolean;
258
196
  define?: {
259
- [key: string]: string;
197
+ [key: string]: string;
260
198
  };
261
199
  pure?: string[];
262
200
  keepNames?: boolean;
@@ -266,21 +204,115 @@ declare class Compiler extends CompilerBase<BuildOptions, {
266
204
  logLimit?: number;
267
205
  logOverride?: Record<string, esbuild.LogLevel>;
268
206
  tsconfigRaw?: string | esbuild.TsconfigRaw;
269
- }>>;
270
- watch: (options: WatchOptions) => Promise<void>;
271
- server: (serverConfig: ServeOptions) => Promise<ServeResult>;
207
+ }>
208
+ >;
209
+ cancel: () => Promise<void>;
210
+ }>;
211
+ input: (input: string | string[]) => Promise<{
212
+ output: (outputConfig: any) => Promise<BuildResult<BuildOptions>>;
213
+ }>;
214
+ build: (options: BuildOptions) => Promise<
215
+ BuildResult<{
216
+ bundle?: boolean;
217
+ splitting?: boolean;
218
+ preserveSymlinks?: boolean;
219
+ outfile?: string;
220
+ metafile?: boolean;
221
+ outdir?: string;
222
+ outbase?: string;
223
+ external?: string[];
224
+ packages?: 'bundle' | 'external';
225
+ alias?: Record<string, string>;
226
+ loader?: {
227
+ [ext: string]: esbuild.Loader;
228
+ };
229
+ resolveExtensions?: string[];
230
+ mainFields?: string[];
231
+ conditions?: string[];
232
+ write?: boolean;
233
+ allowOverwrite?: boolean;
234
+ tsconfig?: string;
235
+ outExtension?: {
236
+ [ext: string]: string;
237
+ };
238
+ publicPath?: string;
239
+ entryNames?: string;
240
+ chunkNames?: string;
241
+ assetNames?: string;
242
+ inject?: string[];
243
+ banner?: {
244
+ [type: string]: string;
245
+ };
246
+ footer?: {
247
+ [type: string]: string;
248
+ };
249
+ entryPoints?:
250
+ | (
251
+ | string
252
+ | {
253
+ in: string;
254
+ out: string;
255
+ }
256
+ )[]
257
+ | Record<string, string>;
258
+ stdin?: esbuild.StdinOptions;
259
+ plugins?: esbuild.Plugin[];
260
+ absWorkingDir?: string;
261
+ nodePaths?: string[];
262
+ sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
263
+ legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
264
+ sourceRoot?: string;
265
+ sourcesContent?: boolean;
266
+ format?: esbuild.Format;
267
+ globalName?: string;
268
+ target?: string | string[];
269
+ supported?: Record<string, boolean>;
270
+ platform?: esbuild.Platform;
271
+ mangleProps?: RegExp;
272
+ reserveProps?: RegExp;
273
+ mangleQuoted?: boolean;
274
+ mangleCache?: Record<string, string | false>;
275
+ drop?: esbuild.Drop[];
276
+ dropLabels?: string[];
277
+ minify?: boolean;
278
+ minifyWhitespace?: boolean;
279
+ minifyIdentifiers?: boolean;
280
+ minifySyntax?: boolean;
281
+ lineLimit?: number;
282
+ charset?: esbuild.Charset;
283
+ treeShaking?: boolean;
284
+ ignoreAnnotations?: boolean;
285
+ jsx?: 'transform' | 'preserve' | 'automatic';
286
+ jsxFactory?: string;
287
+ jsxFragment?: string;
288
+ jsxImportSource?: string;
289
+ jsxDev?: boolean;
290
+ jsxSideEffects?: boolean;
291
+ define?: {
292
+ [key: string]: string;
293
+ };
294
+ pure?: string[];
295
+ keepNames?: boolean;
296
+ absPaths?: esbuild.AbsPaths[];
297
+ color?: boolean;
298
+ logLevel?: esbuild.LogLevel;
299
+ logLimit?: number;
300
+ logOverride?: Record<string, esbuild.LogLevel>;
301
+ tsconfigRaw?: string | esbuild.TsconfigRaw;
302
+ }>
303
+ >;
304
+ watch: (options: WatchOptions) => Promise<void>;
305
+ server: (serverConfig: ServeOptions) => Promise<ServeResult>;
272
306
  }
273
307
  declare const createCompiler: (baseConfig: any) => Compiler;
274
308
 
275
- declare const getDefine: (params: {
276
- NODE_ENV: string;
277
- }) => {
278
- 'process.env.NODE_ENV': string;
309
+ declare const getDefine: (params: { NODE_ENV: string }) => {
310
+ 'process.env.NODE_ENV': string;
279
311
  };
280
312
 
281
313
  type TEnvParams = {
282
- action: 'build' | 'dev' | 'serve';
283
- workRootDir: string;
314
+ action: 'build' | 'dev' | 'serve';
315
+ workRootDir: string;
284
316
  };
285
317
 
286
318
  type TEntryPoints = BuildOptions['entryPoints'];
@@ -296,25 +328,28 @@ type TLoader = BuildOptions['loader'];
296
328
 
297
329
  declare const inputFileDirList: string[];
298
330
  declare const inputFileTypeList: string[];
299
- declare const getEntryPoints: (envParams: TEnvParams, input?: TEntryPoints) => TEntryPoints;
331
+ declare const getEntryPoints: (
332
+ envParams: TEnvParams,
333
+ input?: TEntryPoints
334
+ ) => TEntryPoints;
300
335
 
301
336
  declare const getReactLoaderPreset: () => {
302
- '.js': "jsx";
303
- '.ts': "ts";
304
- '.tsx': "tsx";
305
- '.css': "css";
306
- '.png': "file";
307
- '.svg': "file";
308
- '.json': "json";
337
+ '.js': 'jsx';
338
+ '.ts': 'ts';
339
+ '.tsx': 'tsx';
340
+ '.css': 'css';
341
+ '.png': 'file';
342
+ '.svg': 'file';
343
+ '.json': 'json';
309
344
  };
310
345
  declare const getNodeLoaderPreset: () => {
311
- '.js': "jsx";
312
- '.ts': "ts";
346
+ '.js': 'jsx';
347
+ '.ts': 'ts';
313
348
  };
314
349
 
315
350
  declare const getEsbuildPluginHtml: (params: {
316
- cdnConfig?: TCdn;
317
- entry: string;
351
+ cdnConfig?: TCdn;
352
+ entry: string;
318
353
  }) => esbuild.Plugin;
319
354
 
320
355
  declare const getLessPlugin: () => esbuild.Plugin;
@@ -323,123 +358,177 @@ declare const getPostCssPlugin: () => any;
323
358
 
324
359
  declare const getSassPlugin: () => esbuild.Plugin;
325
360
 
361
+ declare class Ctx {
362
+ configCtx: ConfigCtx;
363
+ esbuildConfig: BuildOptions;
364
+ envParams: TEnvParams;
365
+ constructor(configCtx: ConfigCtx);
366
+ updateEnvParams(argv: Partial<TEnvParams>): void;
367
+ updateEsbuildConfig(config: BuildOptions): void;
368
+ getDoraConfig(): TDoraConfig;
369
+ geTDoraConfigEsbuild(): {};
370
+ }
371
+
372
+ declare const esbuildEntryPointsMw: () => TOnionFun<Ctx>;
373
+
374
+ declare const envParamsMw: (envParams: TEnvParams) => TOnionFun<Ctx>;
375
+
376
+ declare const esbuildReactLoaderMw: () => TOnionFun<Ctx>;
377
+
378
+ declare const esbuildOutputMw: () => TOnionFun<Ctx>;
379
+
380
+ declare const esbuildPlainMw: () => TOnionFun<Ctx>;
381
+
382
+ declare const esbuildStylePluginMw: () => TOnionFun<Ctx>;
383
+
326
384
  declare const getNodeBuildConfigPreset: (options?: BuildOptions) => {
327
- bundle: boolean;
328
- splitting?: boolean;
329
- preserveSymlinks?: boolean;
330
- outfile?: string;
331
- metafile?: boolean;
332
- outdir?: string;
333
- outbase?: string;
334
- external?: string[];
335
- packages?: "bundle" | "external";
336
- alias?: Record<string, string>;
337
- loader: {
338
- [ext: string]: esbuild.Loader;
339
- };
340
- resolveExtensions?: string[];
341
- mainFields?: string[];
342
- conditions?: string[];
343
- write?: boolean;
344
- allowOverwrite?: boolean;
345
- tsconfig?: string;
346
- outExtension?: {
347
- [ext: string]: string;
348
- };
349
- publicPath?: string;
350
- entryNames?: string;
351
- chunkNames?: string;
352
- assetNames?: string;
353
- inject?: string[];
354
- banner?: {
355
- [type: string]: string;
356
- };
357
- footer?: {
358
- [type: string]: string;
359
- };
360
- entryPoints?: (string | {
361
- in: string;
362
- out: string;
363
- })[] | Record<string, string>;
364
- stdin?: esbuild.StdinOptions;
365
- plugins: esbuild.Plugin[];
366
- absWorkingDir?: string;
367
- nodePaths?: string[];
368
- sourcemap: boolean | "linked" | "inline" | "external" | "both";
369
- legalComments?: "none" | "inline" | "eof" | "linked" | "external";
370
- sourceRoot?: string;
371
- sourcesContent?: boolean;
372
- format?: esbuild.Format;
373
- globalName?: string;
374
- target: string | string[];
375
- supported?: Record<string, boolean>;
376
- platform: esbuild.Platform;
377
- mangleProps?: RegExp;
378
- reserveProps?: RegExp;
379
- mangleQuoted?: boolean;
380
- mangleCache?: Record<string, string | false>;
381
- drop?: esbuild.Drop[];
382
- dropLabels?: string[];
383
- minify: boolean;
384
- minifyWhitespace?: boolean;
385
- minifyIdentifiers?: boolean;
386
- minifySyntax?: boolean;
387
- lineLimit?: number;
388
- charset?: esbuild.Charset;
389
- treeShaking?: boolean;
390
- ignoreAnnotations?: boolean;
391
- jsx?: "transform" | "preserve" | "automatic";
392
- jsxFactory?: string;
393
- jsxFragment?: string;
394
- jsxImportSource?: string;
395
- jsxDev?: boolean;
396
- jsxSideEffects?: boolean;
397
- define: {
398
- [key: string]: string;
399
- };
400
- pure?: string[];
401
- keepNames?: boolean;
402
- absPaths?: esbuild.AbsPaths[];
403
- color?: boolean;
404
- logLevel?: esbuild.LogLevel;
405
- logLimit?: number;
406
- logOverride?: Record<string, esbuild.LogLevel>;
407
- tsconfigRaw?: string | esbuild.TsconfigRaw;
385
+ bundle: boolean;
386
+ splitting?: boolean;
387
+ preserveSymlinks?: boolean;
388
+ outfile?: string;
389
+ metafile?: boolean;
390
+ outdir?: string;
391
+ outbase?: string;
392
+ external?: string[];
393
+ packages?: 'bundle' | 'external';
394
+ alias?: Record<string, string>;
395
+ loader: {
396
+ [ext: string]: esbuild.Loader;
397
+ };
398
+ resolveExtensions?: string[];
399
+ mainFields?: string[];
400
+ conditions?: string[];
401
+ write?: boolean;
402
+ allowOverwrite?: boolean;
403
+ tsconfig?: string;
404
+ outExtension?: {
405
+ [ext: string]: string;
406
+ };
407
+ publicPath?: string;
408
+ entryNames?: string;
409
+ chunkNames?: string;
410
+ assetNames?: string;
411
+ inject?: string[];
412
+ banner?: {
413
+ [type: string]: string;
414
+ };
415
+ footer?: {
416
+ [type: string]: string;
417
+ };
418
+ entryPoints?:
419
+ | (
420
+ | string
421
+ | {
422
+ in: string;
423
+ out: string;
424
+ }
425
+ )[]
426
+ | Record<string, string>;
427
+ stdin?: esbuild.StdinOptions;
428
+ plugins: esbuild.Plugin[];
429
+ absWorkingDir?: string;
430
+ nodePaths?: string[];
431
+ sourcemap: boolean | 'linked' | 'inline' | 'external' | 'both';
432
+ legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
433
+ sourceRoot?: string;
434
+ sourcesContent?: boolean;
435
+ format?: esbuild.Format;
436
+ globalName?: string;
437
+ target: string | string[];
438
+ supported?: Record<string, boolean>;
439
+ platform: esbuild.Platform;
440
+ mangleProps?: RegExp;
441
+ reserveProps?: RegExp;
442
+ mangleQuoted?: boolean;
443
+ mangleCache?: Record<string, string | false>;
444
+ drop?: esbuild.Drop[];
445
+ dropLabels?: string[];
446
+ minify: boolean;
447
+ minifyWhitespace?: boolean;
448
+ minifyIdentifiers?: boolean;
449
+ minifySyntax?: boolean;
450
+ lineLimit?: number;
451
+ charset?: esbuild.Charset;
452
+ treeShaking?: boolean;
453
+ ignoreAnnotations?: boolean;
454
+ jsx?: 'transform' | 'preserve' | 'automatic';
455
+ jsxFactory?: string;
456
+ jsxFragment?: string;
457
+ jsxImportSource?: string;
458
+ jsxDev?: boolean;
459
+ jsxSideEffects?: boolean;
460
+ define: {
461
+ [key: string]: string;
462
+ };
463
+ pure?: string[];
464
+ keepNames?: boolean;
465
+ absPaths?: esbuild.AbsPaths[];
466
+ color?: boolean;
467
+ logLevel?: esbuild.LogLevel;
468
+ logLimit?: number;
469
+ logOverride?: Record<string, esbuild.LogLevel>;
470
+ tsconfigRaw?: string | esbuild.TsconfigRaw;
408
471
  };
409
472
 
410
473
  declare const getReactBuildConfigPreset: () => {
411
- entryPoints: string[];
412
- outdir: string;
413
- bundle: boolean;
414
- minify: boolean;
415
- sourcemap: boolean;
416
- target: string[];
417
- platform: string;
418
- external: string[];
419
- define: {
420
- 'process.env.NODE_ENV': string;
421
- };
422
- loader: {
423
- '.png': string;
424
- '.svg': string;
425
- };
426
- plugins: never[];
474
+ entryPoints: string[];
475
+ outdir: string;
476
+ bundle: boolean;
477
+ minify: boolean;
478
+ sourcemap: boolean;
479
+ target: string[];
480
+ platform: string;
481
+ external: string[];
482
+ define: {
483
+ 'process.env.NODE_ENV': string;
484
+ };
485
+ loader: {
486
+ '.png': string;
487
+ '.svg': string;
488
+ };
489
+ plugins: never[];
427
490
  };
428
491
 
429
492
  declare const createContext: () => Promise<esbuild.BuildContext<{}>>;
430
493
 
431
- declare class Ctx {
432
- configCtx: ConfigCtx;
433
- esbuildConfig: BuildOptions;
434
- envParams: TEnvParams;
435
- constructor(configCtx: ConfigCtx);
436
- updateEnvParams(argv: Partial<TEnvParams>): void;
437
- updateEsbuildConfig(config: BuildOptions): void;
438
- getDoraConfig(): TDoraConfig;
439
- geTDoraConfigEsbuild(): {};
440
- }
441
-
442
494
  declare const extractEntry: (entryPoints: TEntryPoints) => string[];
443
495
 
444
- export { Compiler, Ctx, builder, createCompiler, createContext, extractEntry, getDefine, getEntryPoints, getEsbuildPluginHtml, getLessPlugin, getNodeBuildConfigPreset, getNodeLoaderPreset, getPostCssPlugin, getReactBuildConfigPreset, getReactLoaderPreset, getSassPlugin, inputFileDirList, inputFileTypeList };
445
- export type { TBundle, TDefine, TEntryPoints, TEnvParams, TLoader, TMinify, TOutdir, TOutfile, TPlugins, TSourcemap, TTarget };
496
+ export {
497
+ builder,
498
+ Compiler,
499
+ createCompiler,
500
+ createContext,
501
+ Ctx,
502
+ envParamsMw,
503
+ esbuildEntryPointsMw,
504
+ esbuildOutputMw,
505
+ esbuildPlainMw,
506
+ esbuildReactLoaderMw,
507
+ esbuildStylePluginMw,
508
+ extractEntry,
509
+ getDefine,
510
+ getEntryPoints,
511
+ getEsbuildPluginHtml,
512
+ getLessPlugin,
513
+ getNodeBuildConfigPreset,
514
+ getNodeLoaderPreset,
515
+ getPostCssPlugin,
516
+ getReactBuildConfigPreset,
517
+ getReactLoaderPreset,
518
+ getSassPlugin,
519
+ inputFileDirList,
520
+ inputFileTypeList,
521
+ };
522
+ export type {
523
+ TBundle,
524
+ TDefine,
525
+ TEntryPoints,
526
+ TEnvParams,
527
+ TLoader,
528
+ TMinify,
529
+ TOutdir,
530
+ TOutfile,
531
+ TPlugins,
532
+ TSourcemap,
533
+ TTarget,
534
+ };