esbuild 0.14.48 → 0.14.51
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 +4 -1
- package/install.js +11 -5
- package/lib/main.d.ts +9 -5
- package/lib/main.js +97 -72
- package/package.json +21 -21
package/bin/esbuild
CHANGED
|
@@ -14,7 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
}
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
19
|
+
mod
|
|
20
|
+
));
|
|
18
21
|
|
|
19
22
|
// lib/npm/node-platform.ts
|
|
20
23
|
var fs = require("fs");
|
package/install.js
CHANGED
|
@@ -13,7 +13,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
13
|
}
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
17
20
|
|
|
18
21
|
// lib/npm/node-platform.ts
|
|
19
22
|
var fs = require("fs");
|
|
@@ -85,8 +88,8 @@ function validateBinaryVersion(...command) {
|
|
|
85
88
|
const stdout = child_process.execFileSync(command.shift(), command, {
|
|
86
89
|
stdio: "pipe"
|
|
87
90
|
}).toString().trim();
|
|
88
|
-
if (stdout !== "0.14.
|
|
89
|
-
throw new Error(`Expected ${JSON.stringify("0.14.
|
|
91
|
+
if (stdout !== "0.14.51") {
|
|
92
|
+
throw new Error(`Expected ${JSON.stringify("0.14.51")} but got ${JSON.stringify(stdout)}`);
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
function isYarn() {
|
|
@@ -137,7 +140,10 @@ function installUsingNPM(pkg, subpath, binPath) {
|
|
|
137
140
|
fs2.mkdirSync(installDir);
|
|
138
141
|
try {
|
|
139
142
|
fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
|
|
140
|
-
child_process.execSync(
|
|
143
|
+
child_process.execSync(
|
|
144
|
+
`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.51"}`,
|
|
145
|
+
{ cwd: installDir, stdio: "pipe", env }
|
|
146
|
+
);
|
|
141
147
|
const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
|
|
142
148
|
fs2.renameSync(installedBinPath, binPath);
|
|
143
149
|
} finally {
|
|
@@ -186,7 +192,7 @@ function maybeOptimizePackage(binPath) {
|
|
|
186
192
|
}
|
|
187
193
|
}
|
|
188
194
|
async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
|
|
189
|
-
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.
|
|
195
|
+
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.51"}.tgz`;
|
|
190
196
|
console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
|
|
191
197
|
try {
|
|
192
198
|
fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
|
package/lib/main.d.ts
CHANGED
|
@@ -17,12 +17,14 @@ interface CommonOptions {
|
|
|
17
17
|
|
|
18
18
|
/** Documentation: https://esbuild.github.io/api/#format */
|
|
19
19
|
format?: Format;
|
|
20
|
-
/** Documentation: https://esbuild.github.io/api/#
|
|
20
|
+
/** Documentation: https://esbuild.github.io/api/#global-name */
|
|
21
21
|
globalName?: string;
|
|
22
22
|
/** Documentation: https://esbuild.github.io/api/#target */
|
|
23
23
|
target?: string | string[];
|
|
24
24
|
/** Documentation: https://esbuild.github.io/api/#supported */
|
|
25
25
|
supported?: Record<string, boolean>;
|
|
26
|
+
/** Documentation: https://esbuild.github.io/api/#platform */
|
|
27
|
+
platform?: Platform;
|
|
26
28
|
|
|
27
29
|
/** Documentation: https://esbuild.github.io/api/#mangle-props */
|
|
28
30
|
mangleProps?: RegExp;
|
|
@@ -50,11 +52,15 @@ interface CommonOptions {
|
|
|
50
52
|
ignoreAnnotations?: boolean;
|
|
51
53
|
|
|
52
54
|
/** Documentation: https://esbuild.github.io/api/#jsx */
|
|
53
|
-
jsx?: 'transform' | 'preserve';
|
|
55
|
+
jsx?: 'transform' | 'preserve' | 'automatic';
|
|
54
56
|
/** Documentation: https://esbuild.github.io/api/#jsx-factory */
|
|
55
57
|
jsxFactory?: string;
|
|
56
58
|
/** Documentation: https://esbuild.github.io/api/#jsx-fragment */
|
|
57
59
|
jsxFragment?: string;
|
|
60
|
+
/** Documentation: https://esbuild.github.io/api/#jsx-import-source */
|
|
61
|
+
jsxImportSource?: string;
|
|
62
|
+
/** Documentation: https://esbuild.github.io/api/#jsx-development */
|
|
63
|
+
jsxDev?: boolean;
|
|
58
64
|
|
|
59
65
|
/** Documentation: https://esbuild.github.io/api/#define */
|
|
60
66
|
define?: { [key: string]: string };
|
|
@@ -88,15 +94,13 @@ export interface BuildOptions extends CommonOptions {
|
|
|
88
94
|
outdir?: string;
|
|
89
95
|
/** Documentation: https://esbuild.github.io/api/#outbase */
|
|
90
96
|
outbase?: string;
|
|
91
|
-
/** Documentation: https://esbuild.github.io/api/#platform */
|
|
92
|
-
platform?: Platform;
|
|
93
97
|
/** Documentation: https://esbuild.github.io/api/#external */
|
|
94
98
|
external?: string[];
|
|
95
99
|
/** Documentation: https://esbuild.github.io/api/#loader */
|
|
96
100
|
loader?: { [ext: string]: Loader };
|
|
97
101
|
/** Documentation: https://esbuild.github.io/api/#resolve-extensions */
|
|
98
102
|
resolveExtensions?: string[];
|
|
99
|
-
/** Documentation: https://esbuild.github.io/api/#
|
|
103
|
+
/** Documentation: https://esbuild.github.io/api/#main-fields */
|
|
100
104
|
mainFields?: string[];
|
|
101
105
|
/** Documentation: https://esbuild.github.io/api/#conditions */
|
|
102
106
|
conditions?: string[];
|
package/lib/main.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
|
|
23
26
|
// lib/npm/node.ts
|
|
@@ -301,11 +304,14 @@ function pushCommonFlags(flags, options, keys) {
|
|
|
301
304
|
let jsx = getFlag(options, keys, "jsx", mustBeString);
|
|
302
305
|
let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
|
|
303
306
|
let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
|
|
307
|
+
let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString);
|
|
308
|
+
let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean);
|
|
304
309
|
let define = getFlag(options, keys, "define", mustBeObject);
|
|
305
310
|
let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
|
|
306
311
|
let supported = getFlag(options, keys, "supported", mustBeObject);
|
|
307
312
|
let pure = getFlag(options, keys, "pure", mustBeArray);
|
|
308
313
|
let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
|
|
314
|
+
let platform = getFlag(options, keys, "platform", mustBeString);
|
|
309
315
|
if (legalComments)
|
|
310
316
|
flags.push(`--legal-comments=${legalComments}`);
|
|
311
317
|
if (sourceRoot !== void 0)
|
|
@@ -322,6 +328,8 @@ function pushCommonFlags(flags, options, keys) {
|
|
|
322
328
|
flags.push(`--format=${format}`);
|
|
323
329
|
if (globalName)
|
|
324
330
|
flags.push(`--global-name=${globalName}`);
|
|
331
|
+
if (platform)
|
|
332
|
+
flags.push(`--platform=${platform}`);
|
|
325
333
|
if (minify)
|
|
326
334
|
flags.push("--minify");
|
|
327
335
|
if (minifySyntax)
|
|
@@ -351,6 +359,10 @@ function pushCommonFlags(flags, options, keys) {
|
|
|
351
359
|
flags.push(`--jsx-factory=${jsxFactory}`);
|
|
352
360
|
if (jsxFragment)
|
|
353
361
|
flags.push(`--jsx-fragment=${jsxFragment}`);
|
|
362
|
+
if (jsxImportSource)
|
|
363
|
+
flags.push(`--jsx-import-source=${jsxImportSource}`);
|
|
364
|
+
if (jsxDev)
|
|
365
|
+
flags.push(`--jsx-dev`);
|
|
354
366
|
if (define) {
|
|
355
367
|
for (let key in define) {
|
|
356
368
|
if (key.indexOf("=") >= 0)
|
|
@@ -397,7 +409,6 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
|
|
397
409
|
let outfile = getFlag(options, keys, "outfile", mustBeString);
|
|
398
410
|
let outdir = getFlag(options, keys, "outdir", mustBeString);
|
|
399
411
|
let outbase = getFlag(options, keys, "outbase", mustBeString);
|
|
400
|
-
let platform = getFlag(options, keys, "platform", mustBeString);
|
|
401
412
|
let tsconfig = getFlag(options, keys, "tsconfig", mustBeString);
|
|
402
413
|
let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray);
|
|
403
414
|
let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray);
|
|
@@ -451,8 +462,6 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
|
|
451
462
|
flags.push(`--outdir=${outdir}`);
|
|
452
463
|
if (outbase)
|
|
453
464
|
flags.push(`--outbase=${outbase}`);
|
|
454
|
-
if (platform)
|
|
455
|
-
flags.push(`--platform=${platform}`);
|
|
456
465
|
if (tsconfig)
|
|
457
466
|
flags.push(`--tsconfig=${tsconfig}`);
|
|
458
467
|
if (resolveExtensions) {
|
|
@@ -746,8 +755,8 @@ function createChannel(streamIn) {
|
|
|
746
755
|
if (isFirstPacket) {
|
|
747
756
|
isFirstPacket = false;
|
|
748
757
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
749
|
-
if (binaryVersion !== "0.14.
|
|
750
|
-
throw new Error(`Cannot start service: Host version "${"0.14.
|
|
758
|
+
if (binaryVersion !== "0.14.51") {
|
|
759
|
+
throw new Error(`Cannot start service: Host version "${"0.14.51"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
|
751
760
|
}
|
|
752
761
|
return;
|
|
753
762
|
}
|
|
@@ -1134,25 +1143,28 @@ function createChannel(streamIn) {
|
|
|
1134
1143
|
if (plugins && plugins.length > 0) {
|
|
1135
1144
|
if (streamIn.isSync)
|
|
1136
1145
|
return handleError(new Error("Cannot use plugins in synchronous API calls"), "");
|
|
1137
|
-
handlePlugins(options, plugins, key, details, refs).then(
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1146
|
+
handlePlugins(options, plugins, key, details, refs).then(
|
|
1147
|
+
(result) => {
|
|
1148
|
+
if (!result.ok) {
|
|
1149
|
+
handleError(result.error, result.pluginName);
|
|
1150
|
+
} else {
|
|
1151
|
+
try {
|
|
1152
|
+
buildOrServeContinue({
|
|
1153
|
+
...args,
|
|
1154
|
+
key,
|
|
1155
|
+
details,
|
|
1156
|
+
logPluginError,
|
|
1157
|
+
requestPlugins: result.requestPlugins,
|
|
1158
|
+
runOnEndCallbacks: result.runOnEndCallbacks,
|
|
1159
|
+
pluginRefs: result.pluginRefs
|
|
1160
|
+
});
|
|
1161
|
+
} catch (e) {
|
|
1162
|
+
handleError(e, "");
|
|
1163
|
+
}
|
|
1153
1164
|
}
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1165
|
+
},
|
|
1166
|
+
(e) => handleError(e, "")
|
|
1167
|
+
);
|
|
1156
1168
|
} else {
|
|
1157
1169
|
try {
|
|
1158
1170
|
buildOrServeContinue({
|
|
@@ -1256,18 +1268,22 @@ function createChannel(streamIn) {
|
|
|
1256
1268
|
rebuild = () => new Promise((resolve, reject) => {
|
|
1257
1269
|
if (isDisposed || closeData)
|
|
1258
1270
|
throw new Error("Cannot rebuild");
|
|
1259
|
-
sendRequest(
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1271
|
+
sendRequest(
|
|
1272
|
+
refs,
|
|
1273
|
+
{ command: "rebuild", key },
|
|
1274
|
+
(error2, response2) => {
|
|
1275
|
+
if (error2) {
|
|
1276
|
+
const message = { id: "", pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
|
|
1277
|
+
return callback2(failureErrorWithLog("Build failed", [message], []), null);
|
|
1278
|
+
}
|
|
1279
|
+
buildResponseToResult(response2, (error3, result3) => {
|
|
1280
|
+
if (error3)
|
|
1281
|
+
reject(error3);
|
|
1282
|
+
else
|
|
1283
|
+
resolve(result3);
|
|
1284
|
+
});
|
|
1263
1285
|
}
|
|
1264
|
-
|
|
1265
|
-
if (error3)
|
|
1266
|
-
reject(error3);
|
|
1267
|
-
else
|
|
1268
|
-
resolve(result3);
|
|
1269
|
-
});
|
|
1270
|
-
});
|
|
1286
|
+
);
|
|
1271
1287
|
});
|
|
1272
1288
|
refs.ref();
|
|
1273
1289
|
rebuild.dispose = () => {
|
|
@@ -1863,12 +1879,14 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
|
1863
1879
|
}
|
|
1864
1880
|
}
|
|
1865
1881
|
var _a;
|
|
1866
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.
|
|
1882
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.51";
|
|
1867
1883
|
var esbuildCommandAndArgs = () => {
|
|
1868
1884
|
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
|
1869
|
-
throw new Error(
|
|
1885
|
+
throw new Error(
|
|
1886
|
+
`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
|
|
1870
1887
|
|
|
1871
|
-
More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`
|
|
1888
|
+
More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`
|
|
1889
|
+
);
|
|
1872
1890
|
}
|
|
1873
1891
|
if (false) {
|
|
1874
1892
|
return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]];
|
|
@@ -1927,7 +1945,7 @@ var fsAsync = {
|
|
|
1927
1945
|
}
|
|
1928
1946
|
}
|
|
1929
1947
|
};
|
|
1930
|
-
var version = "0.14.
|
|
1948
|
+
var version = "0.14.51";
|
|
1931
1949
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1932
1950
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
|
1933
1951
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -2038,7 +2056,7 @@ var ensureServiceIsRunning = () => {
|
|
|
2038
2056
|
if (longLivedService)
|
|
2039
2057
|
return longLivedService;
|
|
2040
2058
|
let [command, args] = esbuildCommandAndArgs();
|
|
2041
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.14.
|
|
2059
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.14.51"}`, "--ping"), {
|
|
2042
2060
|
windowsHide: true,
|
|
2043
2061
|
stdio: ["pipe", "pipe", "inherit"],
|
|
2044
2062
|
cwd: defaultWD
|
|
@@ -2152,7 +2170,7 @@ var runServiceSync = (callback) => {
|
|
|
2152
2170
|
esbuild: node_exports
|
|
2153
2171
|
});
|
|
2154
2172
|
callback(service);
|
|
2155
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.
|
|
2173
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.51"}`), {
|
|
2156
2174
|
cwd: defaultWD,
|
|
2157
2175
|
windowsHide: true,
|
|
2158
2176
|
input: stdin,
|
|
@@ -2168,12 +2186,11 @@ var workerThreadService = null;
|
|
|
2168
2186
|
var startWorkerThreadService = (worker_threads2) => {
|
|
2169
2187
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
2170
2188
|
let worker = new worker_threads2.Worker(__filename, {
|
|
2171
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.
|
|
2189
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.51" },
|
|
2172
2190
|
transferList: [workerPort],
|
|
2173
2191
|
execArgv: []
|
|
2174
2192
|
});
|
|
2175
2193
|
let nextID = 0;
|
|
2176
|
-
let wasStopped = false;
|
|
2177
2194
|
let fakeBuildError = (text) => {
|
|
2178
2195
|
let error = new Error(`Build failed with 1 error:
|
|
2179
2196
|
error: ${text}`);
|
|
@@ -2201,8 +2218,6 @@ error: ${text}`);
|
|
|
2201
2218
|
}
|
|
2202
2219
|
};
|
|
2203
2220
|
let runCallSync = (command, args) => {
|
|
2204
|
-
if (wasStopped)
|
|
2205
|
-
throw new Error("The service was stopped");
|
|
2206
2221
|
let id = nextID++;
|
|
2207
2222
|
let sharedBuffer = new SharedArrayBuffer(8);
|
|
2208
2223
|
let sharedBufferView = new Int32Array(sharedBuffer);
|
|
@@ -2240,8 +2255,6 @@ error: ${text}`);
|
|
|
2240
2255
|
var startSyncServiceWorker = () => {
|
|
2241
2256
|
let workerPort = worker_threads.workerData.workerPort;
|
|
2242
2257
|
let parentPort = worker_threads.parentPort;
|
|
2243
|
-
let service = ensureServiceIsRunning();
|
|
2244
|
-
defaultWD = worker_threads.workerData.defaultWD;
|
|
2245
2258
|
let extractProperties = (object) => {
|
|
2246
2259
|
let properties = {};
|
|
2247
2260
|
if (object && typeof object === "object") {
|
|
@@ -2251,34 +2264,46 @@ var startSyncServiceWorker = () => {
|
|
|
2251
2264
|
}
|
|
2252
2265
|
return properties;
|
|
2253
2266
|
};
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2267
|
+
try {
|
|
2268
|
+
let service = ensureServiceIsRunning();
|
|
2269
|
+
defaultWD = worker_threads.workerData.defaultWD;
|
|
2270
|
+
parentPort.on("message", (msg) => {
|
|
2271
|
+
(async () => {
|
|
2272
|
+
let { sharedBuffer, id, command, args } = msg;
|
|
2273
|
+
let sharedBufferView = new Int32Array(sharedBuffer);
|
|
2274
|
+
try {
|
|
2275
|
+
switch (command) {
|
|
2276
|
+
case "build":
|
|
2277
|
+
workerPort.postMessage({ id, resolve: await service.build(args[0]) });
|
|
2278
|
+
break;
|
|
2279
|
+
case "transform":
|
|
2280
|
+
workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) });
|
|
2281
|
+
break;
|
|
2282
|
+
case "formatMessages":
|
|
2283
|
+
workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) });
|
|
2284
|
+
break;
|
|
2285
|
+
case "analyzeMetafile":
|
|
2286
|
+
workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) });
|
|
2287
|
+
break;
|
|
2288
|
+
default:
|
|
2289
|
+
throw new Error(`Invalid command: ${command}`);
|
|
2290
|
+
}
|
|
2291
|
+
} catch (reject) {
|
|
2292
|
+
workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
|
|
2274
2293
|
}
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
}
|
|
2294
|
+
Atomics.add(sharedBufferView, 0, 1);
|
|
2295
|
+
Atomics.notify(sharedBufferView, 0, Infinity);
|
|
2296
|
+
})();
|
|
2297
|
+
});
|
|
2298
|
+
} catch (reject) {
|
|
2299
|
+
parentPort.on("message", (msg) => {
|
|
2300
|
+
let { sharedBuffer, id } = msg;
|
|
2301
|
+
let sharedBufferView = new Int32Array(sharedBuffer);
|
|
2302
|
+
workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
|
|
2278
2303
|
Atomics.add(sharedBufferView, 0, 1);
|
|
2279
2304
|
Atomics.notify(sharedBufferView, 0, Infinity);
|
|
2280
|
-
})
|
|
2281
|
-
}
|
|
2305
|
+
});
|
|
2306
|
+
}
|
|
2282
2307
|
};
|
|
2283
2308
|
if (isInternalWorkerThread) {
|
|
2284
2309
|
startSyncServiceWorker();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esbuild",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.51",
|
|
4
4
|
"description": "An extremely fast JavaScript and CSS bundler and minifier.",
|
|
5
5
|
"repository": "https://github.com/evanw/esbuild",
|
|
6
6
|
"scripts": {
|
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
"esbuild": "bin/esbuild"
|
|
16
16
|
},
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"esbuild-android-64": "0.14.
|
|
19
|
-
"esbuild-android-arm64": "0.14.
|
|
20
|
-
"esbuild-darwin-64": "0.14.
|
|
21
|
-
"esbuild-darwin-arm64": "0.14.
|
|
22
|
-
"esbuild-freebsd-64": "0.14.
|
|
23
|
-
"esbuild-freebsd-arm64": "0.14.
|
|
24
|
-
"esbuild-linux-32": "0.14.
|
|
25
|
-
"esbuild-linux-64": "0.14.
|
|
26
|
-
"esbuild-linux-arm": "0.14.
|
|
27
|
-
"esbuild-linux-arm64": "0.14.
|
|
28
|
-
"esbuild-linux-mips64le": "0.14.
|
|
29
|
-
"esbuild-linux-ppc64le": "0.14.
|
|
30
|
-
"esbuild-linux-riscv64": "0.14.
|
|
31
|
-
"esbuild-linux-s390x": "0.14.
|
|
32
|
-
"esbuild-netbsd-64": "0.14.
|
|
33
|
-
"esbuild-openbsd-64": "0.14.
|
|
34
|
-
"esbuild-sunos-64": "0.14.
|
|
35
|
-
"esbuild-windows-32": "0.14.
|
|
36
|
-
"esbuild-windows-64": "0.14.
|
|
37
|
-
"esbuild-windows-arm64": "0.14.
|
|
18
|
+
"esbuild-android-64": "0.14.51",
|
|
19
|
+
"esbuild-android-arm64": "0.14.51",
|
|
20
|
+
"esbuild-darwin-64": "0.14.51",
|
|
21
|
+
"esbuild-darwin-arm64": "0.14.51",
|
|
22
|
+
"esbuild-freebsd-64": "0.14.51",
|
|
23
|
+
"esbuild-freebsd-arm64": "0.14.51",
|
|
24
|
+
"esbuild-linux-32": "0.14.51",
|
|
25
|
+
"esbuild-linux-64": "0.14.51",
|
|
26
|
+
"esbuild-linux-arm": "0.14.51",
|
|
27
|
+
"esbuild-linux-arm64": "0.14.51",
|
|
28
|
+
"esbuild-linux-mips64le": "0.14.51",
|
|
29
|
+
"esbuild-linux-ppc64le": "0.14.51",
|
|
30
|
+
"esbuild-linux-riscv64": "0.14.51",
|
|
31
|
+
"esbuild-linux-s390x": "0.14.51",
|
|
32
|
+
"esbuild-netbsd-64": "0.14.51",
|
|
33
|
+
"esbuild-openbsd-64": "0.14.51",
|
|
34
|
+
"esbuild-sunos-64": "0.14.51",
|
|
35
|
+
"esbuild-windows-32": "0.14.51",
|
|
36
|
+
"esbuild-windows-64": "0.14.51",
|
|
37
|
+
"esbuild-windows-arm64": "0.14.51"
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT"
|
|
40
40
|
}
|