@doracli/esbuild 0.0.2 → 0.0.4
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.
- package/lib/cjs/index.js +632 -312
- package/lib/esm/index.js +648 -317
- package/lib/type/index.d.ts +412 -323
- package/package.json +8 -8
package/lib/type/index.d.ts
CHANGED
|
@@ -1,190 +1,123 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import {
|
|
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 {
|
|
5
|
-
import {
|
|
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: (
|
|
15
|
+
declare const builder: (
|
|
16
|
+
config: BuildOptions
|
|
17
|
+
) => Promise<esbuild.BuildResult<BuildOptions>>;
|
|
8
18
|
|
|
9
|
-
declare class Compiler extends CompilerBase<
|
|
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
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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?:
|
|
129
|
+
packages?: 'bundle' | 'external';
|
|
197
130
|
alias?: Record<string, string>;
|
|
198
131
|
loader?: {
|
|
199
|
-
|
|
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
|
-
|
|
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
|
-
|
|
149
|
+
[type: string]: string;
|
|
217
150
|
};
|
|
218
151
|
footer?: {
|
|
219
|
-
|
|
152
|
+
[type: string]: string;
|
|
220
153
|
};
|
|
221
|
-
entryPoints?:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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 |
|
|
230
|
-
legalComments?:
|
|
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?:
|
|
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
|
-
|
|
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
|
-
|
|
271
|
-
|
|
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
|
-
|
|
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
|
-
|
|
283
|
-
|
|
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: (
|
|
331
|
+
declare const getEntryPoints: (
|
|
332
|
+
envParams: TEnvParams,
|
|
333
|
+
input?: TEntryPoints
|
|
334
|
+
) => TEntryPoints;
|
|
300
335
|
|
|
301
336
|
declare const getReactLoaderPreset: () => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
-
|
|
312
|
-
|
|
346
|
+
'.js': 'jsx';
|
|
347
|
+
'.ts': 'ts';
|
|
313
348
|
};
|
|
314
349
|
|
|
315
350
|
declare const getEsbuildPluginHtml: (params: {
|
|
316
|
-
|
|
317
|
-
|
|
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
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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 {
|
|
445
|
-
|
|
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
|
+
};
|