esbuild 0.13.7 → 0.13.11
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/bin/esbuild +2 -0
- package/install.js +7 -4
- package/lib/main.d.ts +177 -69
- package/lib/main.js +9 -7
- package/package.json +19 -19
package/bin/esbuild
CHANGED
|
@@ -5,6 +5,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __reflectGet = Reflect.get;
|
|
9
|
+
var __reflectSet = Reflect.set;
|
|
8
10
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
9
11
|
var __reExport = (target, module2, desc) => {
|
|
10
12
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
package/install.js
CHANGED
|
@@ -8,6 +8,8 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __reflectGet = Reflect.get;
|
|
12
|
+
var __reflectSet = Reflect.set;
|
|
11
13
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
14
|
var __spreadValues = (a, b) => {
|
|
13
15
|
for (var prop in b || (b = {}))
|
|
@@ -92,8 +94,8 @@ var isToPathJS = true;
|
|
|
92
94
|
function validateBinaryVersion(...command) {
|
|
93
95
|
command.push("--version");
|
|
94
96
|
const stdout = child_process.execFileSync(command.shift(), command).toString().trim();
|
|
95
|
-
if (stdout !== "0.13.
|
|
96
|
-
throw new Error(`Expected ${JSON.stringify("0.13.
|
|
97
|
+
if (stdout !== "0.13.11") {
|
|
98
|
+
throw new Error(`Expected ${JSON.stringify("0.13.11")} but got ${JSON.stringify(stdout)}`);
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
function isYarn() {
|
|
@@ -144,7 +146,7 @@ function installUsingNPM(pkg, subpath, binPath) {
|
|
|
144
146
|
fs2.mkdirSync(installDir);
|
|
145
147
|
try {
|
|
146
148
|
fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
|
|
147
|
-
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.13.
|
|
149
|
+
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.13.11"}`, { cwd: installDir, stdio: "pipe", env });
|
|
148
150
|
const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
|
|
149
151
|
fs2.renameSync(installedBinPath, binPath);
|
|
150
152
|
} finally {
|
|
@@ -187,12 +189,13 @@ function maybeOptimizePackage(binPath) {
|
|
|
187
189
|
fs2.linkSync(binPath, tempPath);
|
|
188
190
|
fs2.renameSync(tempPath, toPath);
|
|
189
191
|
isToPathJS = false;
|
|
192
|
+
fs2.unlinkSync(tempPath);
|
|
190
193
|
} catch (e) {
|
|
191
194
|
}
|
|
192
195
|
}
|
|
193
196
|
}
|
|
194
197
|
async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
|
|
195
|
-
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.13.
|
|
198
|
+
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.13.11"}.tgz`;
|
|
196
199
|
console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
|
|
197
200
|
try {
|
|
198
201
|
fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
|
package/lib/main.d.ts
CHANGED
|
@@ -5,67 +5,121 @@ export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'sil
|
|
|
5
5
|
export type Charset = 'ascii' | 'utf8';
|
|
6
6
|
|
|
7
7
|
interface CommonOptions {
|
|
8
|
+
/** Documentation: https://esbuild.github.io/api/#sourcemap */
|
|
8
9
|
sourcemap?: boolean | 'inline' | 'external' | 'both';
|
|
10
|
+
/** Documentation: https://esbuild.github.io/api/#legal-comments */
|
|
9
11
|
legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
|
|
12
|
+
/** Documentation: https://esbuild.github.io/api/#source-root */
|
|
10
13
|
sourceRoot?: string;
|
|
14
|
+
/** Documentation: https://esbuild.github.io/api/#sources-content */
|
|
11
15
|
sourcesContent?: boolean;
|
|
12
16
|
|
|
17
|
+
/** Documentation: https://esbuild.github.io/api/#format */
|
|
13
18
|
format?: Format;
|
|
19
|
+
/** Documentation: https://esbuild.github.io/api/#globalName */
|
|
14
20
|
globalName?: string;
|
|
21
|
+
/** Documentation: https://esbuild.github.io/api/#target */
|
|
15
22
|
target?: string | string[];
|
|
16
23
|
|
|
24
|
+
/** Documentation: https://esbuild.github.io/api/#minify */
|
|
17
25
|
minify?: boolean;
|
|
26
|
+
/** Documentation: https://esbuild.github.io/api/#minify */
|
|
18
27
|
minifyWhitespace?: boolean;
|
|
28
|
+
/** Documentation: https://esbuild.github.io/api/#minify */
|
|
19
29
|
minifyIdentifiers?: boolean;
|
|
30
|
+
/** Documentation: https://esbuild.github.io/api/#minify */
|
|
20
31
|
minifySyntax?: boolean;
|
|
32
|
+
/** Documentation: https://esbuild.github.io/api/#charset */
|
|
21
33
|
charset?: Charset;
|
|
34
|
+
/** Documentation: https://esbuild.github.io/api/#tree-shaking */
|
|
22
35
|
treeShaking?: boolean;
|
|
36
|
+
/** Documentation: https://esbuild.github.io/api/#ignore-annotations */
|
|
23
37
|
ignoreAnnotations?: boolean;
|
|
24
38
|
|
|
39
|
+
/** Documentation: https://esbuild.github.io/api/#jsx */
|
|
25
40
|
jsx?: 'transform' | 'preserve';
|
|
41
|
+
/** Documentation: https://esbuild.github.io/api/#jsx-factory */
|
|
26
42
|
jsxFactory?: string;
|
|
43
|
+
/** Documentation: https://esbuild.github.io/api/#jsx-fragment */
|
|
27
44
|
jsxFragment?: string;
|
|
28
45
|
|
|
46
|
+
/** Documentation: https://esbuild.github.io/api/#define */
|
|
29
47
|
define?: { [key: string]: string };
|
|
48
|
+
/** Documentation: https://esbuild.github.io/api/#pure */
|
|
30
49
|
pure?: string[];
|
|
50
|
+
/** Documentation: https://esbuild.github.io/api/#keep-names */
|
|
31
51
|
keepNames?: boolean;
|
|
32
52
|
|
|
53
|
+
/** Documentation: https://esbuild.github.io/api/#color */
|
|
33
54
|
color?: boolean;
|
|
55
|
+
/** Documentation: https://esbuild.github.io/api/#log-level */
|
|
34
56
|
logLevel?: LogLevel;
|
|
57
|
+
/** Documentation: https://esbuild.github.io/api/#log-limit */
|
|
35
58
|
logLimit?: number;
|
|
36
59
|
}
|
|
37
60
|
|
|
38
61
|
export interface BuildOptions extends CommonOptions {
|
|
62
|
+
/** Documentation: https://esbuild.github.io/api/#bundle */
|
|
39
63
|
bundle?: boolean;
|
|
64
|
+
/** Documentation: https://esbuild.github.io/api/#splitting */
|
|
40
65
|
splitting?: boolean;
|
|
66
|
+
/** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
|
|
41
67
|
preserveSymlinks?: boolean;
|
|
68
|
+
/** Documentation: https://esbuild.github.io/api/#outfile */
|
|
42
69
|
outfile?: string;
|
|
70
|
+
/** Documentation: https://esbuild.github.io/api/#metafile */
|
|
43
71
|
metafile?: boolean;
|
|
72
|
+
/** Documentation: https://esbuild.github.io/api/#outdir */
|
|
44
73
|
outdir?: string;
|
|
74
|
+
/** Documentation: https://esbuild.github.io/api/#outbase */
|
|
45
75
|
outbase?: string;
|
|
76
|
+
/** Documentation: https://esbuild.github.io/api/#platform */
|
|
46
77
|
platform?: Platform;
|
|
78
|
+
/** Documentation: https://esbuild.github.io/api/#external */
|
|
47
79
|
external?: string[];
|
|
80
|
+
/** Documentation: https://esbuild.github.io/api/#loader */
|
|
48
81
|
loader?: { [ext: string]: Loader };
|
|
82
|
+
/** Documentation: https://esbuild.github.io/api/#resolve-extensions */
|
|
49
83
|
resolveExtensions?: string[];
|
|
84
|
+
/** Documentation: https://esbuild.github.io/api/#mainFields */
|
|
50
85
|
mainFields?: string[];
|
|
86
|
+
/** Documentation: https://esbuild.github.io/api/#conditions */
|
|
51
87
|
conditions?: string[];
|
|
88
|
+
/** Documentation: https://esbuild.github.io/api/#write */
|
|
52
89
|
write?: boolean;
|
|
90
|
+
/** Documentation: https://esbuild.github.io/api/#allow-overwrite */
|
|
53
91
|
allowOverwrite?: boolean;
|
|
92
|
+
/** Documentation: https://esbuild.github.io/api/#tsconfig */
|
|
54
93
|
tsconfig?: string;
|
|
94
|
+
/** Documentation: https://esbuild.github.io/api/#out-extension */
|
|
55
95
|
outExtension?: { [ext: string]: string };
|
|
96
|
+
/** Documentation: https://esbuild.github.io/api/#public-path */
|
|
56
97
|
publicPath?: string;
|
|
98
|
+
/** Documentation: https://esbuild.github.io/api/#entry-names */
|
|
57
99
|
entryNames?: string;
|
|
100
|
+
/** Documentation: https://esbuild.github.io/api/#chunk-names */
|
|
58
101
|
chunkNames?: string;
|
|
102
|
+
/** Documentation: https://esbuild.github.io/api/#asset-names */
|
|
59
103
|
assetNames?: string;
|
|
104
|
+
/** Documentation: https://esbuild.github.io/api/#inject */
|
|
60
105
|
inject?: string[];
|
|
106
|
+
/** Documentation: https://esbuild.github.io/api/#banner */
|
|
61
107
|
banner?: { [type: string]: string };
|
|
108
|
+
/** Documentation: https://esbuild.github.io/api/#footer */
|
|
62
109
|
footer?: { [type: string]: string };
|
|
110
|
+
/** Documentation: https://esbuild.github.io/api/#incremental */
|
|
63
111
|
incremental?: boolean;
|
|
112
|
+
/** Documentation: https://esbuild.github.io/api/#entry-points */
|
|
64
113
|
entryPoints?: string[] | Record<string, string>;
|
|
114
|
+
/** Documentation: https://esbuild.github.io/api/#stdin */
|
|
65
115
|
stdin?: StdinOptions;
|
|
116
|
+
/** Documentation: https://esbuild.github.io/plugins/ */
|
|
66
117
|
plugins?: Plugin[];
|
|
118
|
+
/** Documentation: https://esbuild.github.io/api/#working-directory */
|
|
67
119
|
absWorkingDir?: string;
|
|
120
|
+
/** Documentation: https://esbuild.github.io/api/#node-paths */
|
|
68
121
|
nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
|
|
122
|
+
/** Documentation: https://esbuild.github.io/api/#watch */
|
|
69
123
|
watch?: boolean | WatchMode;
|
|
70
124
|
}
|
|
71
125
|
|
|
@@ -86,8 +140,10 @@ export interface Message {
|
|
|
86
140
|
location: Location | null;
|
|
87
141
|
notes: Note[];
|
|
88
142
|
|
|
89
|
-
|
|
90
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Optional user-specified data that is passed through unmodified. You can
|
|
145
|
+
* use this to stash the original error, for example.
|
|
146
|
+
*/
|
|
91
147
|
detail: any;
|
|
92
148
|
}
|
|
93
149
|
|
|
@@ -99,17 +155,22 @@ export interface Note {
|
|
|
99
155
|
export interface Location {
|
|
100
156
|
file: string;
|
|
101
157
|
namespace: string;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
158
|
+
/** 1-based */
|
|
159
|
+
line: number;
|
|
160
|
+
/** 0-based, in bytes */
|
|
161
|
+
column: number;
|
|
162
|
+
/** in bytes */
|
|
163
|
+
length: number;
|
|
105
164
|
lineText: string;
|
|
106
165
|
suggestion: string;
|
|
107
166
|
}
|
|
108
167
|
|
|
109
168
|
export interface OutputFile {
|
|
110
169
|
path: string;
|
|
111
|
-
|
|
112
|
-
|
|
170
|
+
/** "text" as bytes */
|
|
171
|
+
contents: Uint8Array;
|
|
172
|
+
/** "contents" as text */
|
|
173
|
+
text: string;
|
|
113
174
|
}
|
|
114
175
|
|
|
115
176
|
export interface BuildInvalidate {
|
|
@@ -124,10 +185,14 @@ export interface BuildIncremental extends BuildResult {
|
|
|
124
185
|
export interface BuildResult {
|
|
125
186
|
errors: Message[];
|
|
126
187
|
warnings: Message[];
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
188
|
+
/** Only when "write: false" */
|
|
189
|
+
outputFiles?: OutputFile[];
|
|
190
|
+
/** Only when "incremental: true" */
|
|
191
|
+
rebuild?: BuildInvalidate;
|
|
192
|
+
/** Only when "watch: true" */
|
|
193
|
+
stop?: () => void;
|
|
194
|
+
/** Only when "metafile: true" */
|
|
195
|
+
metafile?: Metafile;
|
|
131
196
|
}
|
|
132
197
|
|
|
133
198
|
export interface BuildFailure extends Error {
|
|
@@ -135,6 +200,7 @@ export interface BuildFailure extends Error {
|
|
|
135
200
|
warnings: Message[];
|
|
136
201
|
}
|
|
137
202
|
|
|
203
|
+
/** Documentation: https://esbuild.github.io/api/#serve-arguments */
|
|
138
204
|
export interface ServeOptions {
|
|
139
205
|
port?: number;
|
|
140
206
|
host?: string;
|
|
@@ -147,9 +213,11 @@ export interface ServeOnRequestArgs {
|
|
|
147
213
|
method: string;
|
|
148
214
|
path: string;
|
|
149
215
|
status: number;
|
|
150
|
-
|
|
216
|
+
/** The time to generate the response, not to send it */
|
|
217
|
+
timeInMS: number;
|
|
151
218
|
}
|
|
152
219
|
|
|
220
|
+
/** Documentation: https://esbuild.github.io/api/#serve-return-values */
|
|
153
221
|
export interface ServeResult {
|
|
154
222
|
port: number;
|
|
155
223
|
host: string;
|
|
@@ -327,89 +395,129 @@ export interface AnalyzeMetafileOptions {
|
|
|
327
395
|
verbose?: boolean;
|
|
328
396
|
}
|
|
329
397
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
398
|
+
/**
|
|
399
|
+
* This function invokes the "esbuild" command-line tool for you. It returns a
|
|
400
|
+
* promise that either resolves with a "BuildResult" object or rejects with a
|
|
401
|
+
* "BuildFailure" object.
|
|
402
|
+
*
|
|
403
|
+
* - Works in node: yes
|
|
404
|
+
* - Works in browser: yes
|
|
405
|
+
*
|
|
406
|
+
* Documentation: https://esbuild.github.io/api/#build-api
|
|
407
|
+
*/
|
|
336
408
|
export declare function build(options: BuildOptions & { write: false }): Promise<BuildResult & { outputFiles: OutputFile[] }>;
|
|
337
409
|
export declare function build(options: BuildOptions & { incremental: true }): Promise<BuildIncremental>;
|
|
338
410
|
export declare function build(options: BuildOptions): Promise<BuildResult>;
|
|
339
411
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
412
|
+
/**
|
|
413
|
+
* This function is similar to "build" but it serves the resulting files over
|
|
414
|
+
* HTTP on a localhost address with the specified port.
|
|
415
|
+
*
|
|
416
|
+
* - Works in node: yes
|
|
417
|
+
* - Works in browser: no
|
|
418
|
+
*
|
|
419
|
+
* Documentation: https://esbuild.github.io/api/#serve
|
|
420
|
+
*/
|
|
345
421
|
export declare function serve(serveOptions: ServeOptions, buildOptions: BuildOptions): Promise<ServeResult>;
|
|
346
422
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
423
|
+
/**
|
|
424
|
+
* This function transforms a single JavaScript file. It can be used to minify
|
|
425
|
+
* JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
|
|
426
|
+
* to older JavaScript. It returns a promise that is either resolved with a
|
|
427
|
+
* "TransformResult" object or rejected with a "TransformFailure" object.
|
|
428
|
+
*
|
|
429
|
+
* - Works in node: yes
|
|
430
|
+
* - Works in browser: yes
|
|
431
|
+
*
|
|
432
|
+
* Documentation: https://esbuild.github.io/api/#transform-api
|
|
433
|
+
*/
|
|
354
434
|
export declare function transform(input: string, options?: TransformOptions): Promise<TransformResult>;
|
|
355
435
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
436
|
+
/**
|
|
437
|
+
* Converts log messages to formatted message strings suitable for printing in
|
|
438
|
+
* the terminal. This allows you to reuse the built-in behavior of esbuild's
|
|
439
|
+
* log message formatter. This is a batch-oriented API for efficiency.
|
|
440
|
+
*
|
|
441
|
+
* - Works in node: yes
|
|
442
|
+
* - Works in browser: yes
|
|
443
|
+
*/
|
|
362
444
|
export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>;
|
|
363
445
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
446
|
+
/**
|
|
447
|
+
* Pretty-prints an analysis of the metafile JSON to a string. This is just for
|
|
448
|
+
* convenience to be able to match esbuild's pretty-printing exactly. If you want
|
|
449
|
+
* to customize it, you can just inspect the data in the metafile yourself.
|
|
450
|
+
*
|
|
451
|
+
* - Works in node: yes
|
|
452
|
+
* - Works in browser: yes
|
|
453
|
+
*
|
|
454
|
+
* Documentation: https://esbuild.github.io/api/#analyze
|
|
455
|
+
*/
|
|
370
456
|
export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>;
|
|
371
457
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
458
|
+
/**
|
|
459
|
+
* A synchronous version of "build".
|
|
460
|
+
*
|
|
461
|
+
* - Works in node: yes
|
|
462
|
+
* - Works in browser: no
|
|
463
|
+
*
|
|
464
|
+
* Documentation: https://esbuild.github.io/api/#build-api
|
|
465
|
+
*/
|
|
376
466
|
export declare function buildSync(options: BuildOptions & { write: false }): BuildResult & { outputFiles: OutputFile[] };
|
|
377
467
|
export declare function buildSync(options: BuildOptions): BuildResult;
|
|
378
468
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
469
|
+
/**
|
|
470
|
+
* A synchronous version of "transform".
|
|
471
|
+
*
|
|
472
|
+
* - Works in node: yes
|
|
473
|
+
* - Works in browser: no
|
|
474
|
+
*
|
|
475
|
+
* Documentation: https://esbuild.github.io/api/#transform-api
|
|
476
|
+
*/
|
|
383
477
|
export declare function transformSync(input: string, options?: TransformOptions): TransformResult;
|
|
384
478
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
479
|
+
/**
|
|
480
|
+
* A synchronous version of "formatMessages".
|
|
481
|
+
*
|
|
482
|
+
* - Works in node: yes
|
|
483
|
+
* - Works in browser: no
|
|
484
|
+
*/
|
|
389
485
|
export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
|
|
390
486
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
487
|
+
/**
|
|
488
|
+
* A synchronous version of "analyzeMetafile".
|
|
489
|
+
*
|
|
490
|
+
* - Works in node: yes
|
|
491
|
+
* - Works in browser: no
|
|
492
|
+
*
|
|
493
|
+
* Documentation: https://esbuild.github.io/api/#analyze
|
|
494
|
+
*/
|
|
395
495
|
export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string;
|
|
396
496
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
497
|
+
/**
|
|
498
|
+
* This configures the browser-based version of esbuild. It is necessary to
|
|
499
|
+
* call this first and wait for the returned promise to be resolved before
|
|
500
|
+
* making other API calls when using esbuild in the browser.
|
|
501
|
+
*
|
|
502
|
+
* - Works in node: yes
|
|
503
|
+
* - Works in browser: yes ("options" is required)
|
|
504
|
+
*
|
|
505
|
+
* Documentation: https://esbuild.github.io/api/#running-in-the-browser
|
|
506
|
+
*/
|
|
403
507
|
export declare function initialize(options: InitializeOptions): Promise<void>;
|
|
404
508
|
|
|
405
509
|
export interface InitializeOptions {
|
|
406
|
-
|
|
407
|
-
|
|
510
|
+
/**
|
|
511
|
+
* The URL of the "esbuild.wasm" file. This must be provided when running
|
|
512
|
+
* esbuild in the browser.
|
|
513
|
+
*/
|
|
408
514
|
wasmURL?: string
|
|
409
515
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
516
|
+
/**
|
|
517
|
+
* By default esbuild runs the WebAssembly-based browser API in a web worker
|
|
518
|
+
* to avoid blocking the UI thread. This can be disabled by setting "worker"
|
|
519
|
+
* to false.
|
|
520
|
+
*/
|
|
413
521
|
worker?: boolean
|
|
414
522
|
}
|
|
415
523
|
|
package/lib/main.js
CHANGED
|
@@ -8,6 +8,8 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __reflectGet = Reflect.get;
|
|
12
|
+
var __reflectSet = Reflect.set;
|
|
11
13
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
14
|
var __spreadValues = (a, b) => {
|
|
13
15
|
for (var prop in b || (b = {}))
|
|
@@ -709,8 +711,8 @@ function createChannel(streamIn) {
|
|
|
709
711
|
if (isFirstPacket) {
|
|
710
712
|
isFirstPacket = false;
|
|
711
713
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
712
|
-
if (binaryVersion !== "0.13.
|
|
713
|
-
throw new Error(`Cannot start service: Host version "${"0.13.
|
|
714
|
+
if (binaryVersion !== "0.13.11") {
|
|
715
|
+
throw new Error(`Cannot start service: Host version "${"0.13.11"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
|
714
716
|
}
|
|
715
717
|
return;
|
|
716
718
|
}
|
|
@@ -1686,7 +1688,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
|
1686
1688
|
}
|
|
1687
1689
|
}
|
|
1688
1690
|
var _a;
|
|
1689
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.13.
|
|
1691
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.13.11";
|
|
1690
1692
|
var esbuildCommandAndArgs = () => {
|
|
1691
1693
|
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
|
1692
1694
|
throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
|
|
@@ -1745,7 +1747,7 @@ var fsAsync = {
|
|
|
1745
1747
|
}
|
|
1746
1748
|
}
|
|
1747
1749
|
};
|
|
1748
|
-
var version = "0.13.
|
|
1750
|
+
var version = "0.13.11";
|
|
1749
1751
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1750
1752
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
|
1751
1753
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -1854,7 +1856,7 @@ var ensureServiceIsRunning = () => {
|
|
|
1854
1856
|
if (longLivedService)
|
|
1855
1857
|
return longLivedService;
|
|
1856
1858
|
let [command, args] = esbuildCommandAndArgs();
|
|
1857
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.13.
|
|
1859
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.13.11"}`, "--ping"), {
|
|
1858
1860
|
windowsHide: true,
|
|
1859
1861
|
stdio: ["pipe", "pipe", "inherit"],
|
|
1860
1862
|
cwd: defaultWD
|
|
@@ -1961,7 +1963,7 @@ var runServiceSync = (callback) => {
|
|
|
1961
1963
|
isBrowser: false
|
|
1962
1964
|
});
|
|
1963
1965
|
callback(service);
|
|
1964
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.13.
|
|
1966
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.13.11"}`), {
|
|
1965
1967
|
cwd: defaultWD,
|
|
1966
1968
|
windowsHide: true,
|
|
1967
1969
|
input: stdin,
|
|
@@ -1977,7 +1979,7 @@ var workerThreadService = null;
|
|
|
1977
1979
|
var startWorkerThreadService = (worker_threads2) => {
|
|
1978
1980
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
1979
1981
|
let worker = new worker_threads2.Worker(__filename, {
|
|
1980
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.13.
|
|
1982
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.13.11" },
|
|
1981
1983
|
transferList: [workerPort],
|
|
1982
1984
|
execArgv: []
|
|
1983
1985
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esbuild",
|
|
3
|
-
"version": "0.13.
|
|
4
|
-
"description": "An extremely fast JavaScript bundler and minifier.",
|
|
3
|
+
"version": "0.13.11",
|
|
4
|
+
"description": "An extremely fast JavaScript and CSS bundler and minifier.",
|
|
5
5
|
"repository": "https://github.com/evanw/esbuild",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "node install.js"
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
"esbuild": "bin/esbuild"
|
|
13
13
|
},
|
|
14
14
|
"optionalDependencies": {
|
|
15
|
-
"esbuild-android-arm64": "0.13.
|
|
16
|
-
"esbuild-darwin-64": "0.13.
|
|
17
|
-
"esbuild-darwin-arm64": "0.13.
|
|
18
|
-
"esbuild-freebsd-64": "0.13.
|
|
19
|
-
"esbuild-freebsd-arm64": "0.13.
|
|
20
|
-
"esbuild-linux-32": "0.13.
|
|
21
|
-
"esbuild-linux-64": "0.13.
|
|
22
|
-
"esbuild-linux-arm": "0.13.
|
|
23
|
-
"esbuild-linux-arm64": "0.13.
|
|
24
|
-
"esbuild-linux-mips64le": "0.13.
|
|
25
|
-
"esbuild-linux-ppc64le": "0.13.
|
|
26
|
-
"esbuild-netbsd-64": "0.13.
|
|
27
|
-
"esbuild-openbsd-64": "0.13.
|
|
28
|
-
"esbuild-sunos-64": "0.13.
|
|
29
|
-
"esbuild-windows-32": "0.13.
|
|
30
|
-
"esbuild-windows-64": "0.13.
|
|
31
|
-
"esbuild-windows-arm64": "0.13.
|
|
15
|
+
"esbuild-android-arm64": "0.13.11",
|
|
16
|
+
"esbuild-darwin-64": "0.13.11",
|
|
17
|
+
"esbuild-darwin-arm64": "0.13.11",
|
|
18
|
+
"esbuild-freebsd-64": "0.13.11",
|
|
19
|
+
"esbuild-freebsd-arm64": "0.13.11",
|
|
20
|
+
"esbuild-linux-32": "0.13.11",
|
|
21
|
+
"esbuild-linux-64": "0.13.11",
|
|
22
|
+
"esbuild-linux-arm": "0.13.11",
|
|
23
|
+
"esbuild-linux-arm64": "0.13.11",
|
|
24
|
+
"esbuild-linux-mips64le": "0.13.11",
|
|
25
|
+
"esbuild-linux-ppc64le": "0.13.11",
|
|
26
|
+
"esbuild-netbsd-64": "0.13.11",
|
|
27
|
+
"esbuild-openbsd-64": "0.13.11",
|
|
28
|
+
"esbuild-sunos-64": "0.13.11",
|
|
29
|
+
"esbuild-windows-32": "0.13.11",
|
|
30
|
+
"esbuild-windows-64": "0.13.11",
|
|
31
|
+
"esbuild-windows-arm64": "0.13.11"
|
|
32
32
|
},
|
|
33
33
|
"license": "MIT"
|
|
34
34
|
}
|