esbuild 0.14.9 → 0.14.10
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/install.js +4 -4
- package/lib/main.d.ts +2 -0
- package/lib/main.js +17 -13
- package/package.json +19 -19
package/install.js
CHANGED
|
@@ -93,8 +93,8 @@ var isToPathJS = true;
|
|
|
93
93
|
function validateBinaryVersion(...command) {
|
|
94
94
|
command.push("--version");
|
|
95
95
|
const stdout = child_process.execFileSync(command.shift(), command).toString().trim();
|
|
96
|
-
if (stdout !== "0.14.
|
|
97
|
-
throw new Error(`Expected ${JSON.stringify("0.14.
|
|
96
|
+
if (stdout !== "0.14.10") {
|
|
97
|
+
throw new Error(`Expected ${JSON.stringify("0.14.10")} but got ${JSON.stringify(stdout)}`);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
function isYarn() {
|
|
@@ -145,7 +145,7 @@ function installUsingNPM(pkg, subpath, binPath) {
|
|
|
145
145
|
fs2.mkdirSync(installDir);
|
|
146
146
|
try {
|
|
147
147
|
fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
|
|
148
|
-
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.
|
|
148
|
+
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.10"}`, { cwd: installDir, stdio: "pipe", env });
|
|
149
149
|
const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
|
|
150
150
|
fs2.renameSync(installedBinPath, binPath);
|
|
151
151
|
} finally {
|
|
@@ -194,7 +194,7 @@ function maybeOptimizePackage(binPath) {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
|
|
197
|
-
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.
|
|
197
|
+
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.10"}.tgz`;
|
|
198
198
|
console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
|
|
199
199
|
try {
|
|
200
200
|
fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
|
package/lib/main.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type Format = 'iife' | 'cjs' | 'esm';
|
|
|
3
3
|
export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
|
|
4
4
|
export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
|
|
5
5
|
export type Charset = 'ascii' | 'utf8';
|
|
6
|
+
export type Drop = 'console' | 'debugger';
|
|
6
7
|
|
|
7
8
|
interface CommonOptions {
|
|
8
9
|
/** Documentation: https://esbuild.github.io/api/#sourcemap */
|
|
@@ -21,6 +22,7 @@ interface CommonOptions {
|
|
|
21
22
|
/** Documentation: https://esbuild.github.io/api/#target */
|
|
22
23
|
target?: string | string[];
|
|
23
24
|
|
|
25
|
+
drop?: Drop[];
|
|
24
26
|
/** Documentation: https://esbuild.github.io/api/#minify */
|
|
25
27
|
minify?: boolean;
|
|
26
28
|
/** Documentation: https://esbuild.github.io/api/#minify */
|
package/lib/main.js
CHANGED
|
@@ -263,7 +263,7 @@ function checkForInvalidFlags(object, keys, where) {
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
function validateInitializeOptions(options) {
|
|
266
|
-
let keys = Object.create(null);
|
|
266
|
+
let keys = /* @__PURE__ */ Object.create(null);
|
|
267
267
|
let wasmURL = getFlag(options, keys, "wasmURL", mustBeString);
|
|
268
268
|
let worker = getFlag(options, keys, "worker", mustBeBoolean);
|
|
269
269
|
checkForInvalidFlags(options, keys, "in startService() call");
|
|
@@ -294,6 +294,7 @@ function pushCommonFlags(flags, options, keys) {
|
|
|
294
294
|
let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean);
|
|
295
295
|
let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
|
|
296
296
|
let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean);
|
|
297
|
+
let drop = getFlag(options, keys, "drop", mustBeArray);
|
|
297
298
|
let charset = getFlag(options, keys, "charset", mustBeString);
|
|
298
299
|
let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean);
|
|
299
300
|
let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean);
|
|
@@ -333,6 +334,9 @@ function pushCommonFlags(flags, options, keys) {
|
|
|
333
334
|
flags.push(`--tree-shaking=${treeShaking}`);
|
|
334
335
|
if (ignoreAnnotations)
|
|
335
336
|
flags.push(`--ignore-annotations`);
|
|
337
|
+
if (drop)
|
|
338
|
+
for (let what of drop)
|
|
339
|
+
flags.push(`--drop:${what}`);
|
|
336
340
|
if (jsx)
|
|
337
341
|
flags.push(`--jsx=${jsx}`);
|
|
338
342
|
if (jsxFactory)
|
|
@@ -356,7 +360,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
|
|
356
360
|
var _a2;
|
|
357
361
|
let flags = [];
|
|
358
362
|
let entries = [];
|
|
359
|
-
let keys = Object.create(null);
|
|
363
|
+
let keys = /* @__PURE__ */ Object.create(null);
|
|
360
364
|
let stdinContents = null;
|
|
361
365
|
let stdinResolveDir = null;
|
|
362
366
|
let watchMode = null;
|
|
@@ -406,7 +410,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
|
|
406
410
|
if (typeof watch === "boolean") {
|
|
407
411
|
watchMode = {};
|
|
408
412
|
} else {
|
|
409
|
-
let watchKeys = Object.create(null);
|
|
413
|
+
let watchKeys = /* @__PURE__ */ Object.create(null);
|
|
410
414
|
let onRebuild = getFlag(watch, watchKeys, "onRebuild", mustBeFunction);
|
|
411
415
|
checkForInvalidFlags(watch, watchKeys, `on "watch" in ${callName}() call`);
|
|
412
416
|
watchMode = { onRebuild };
|
|
@@ -512,7 +516,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
|
|
512
516
|
}
|
|
513
517
|
}
|
|
514
518
|
if (stdin) {
|
|
515
|
-
let stdinKeys = Object.create(null);
|
|
519
|
+
let stdinKeys = /* @__PURE__ */ Object.create(null);
|
|
516
520
|
let contents = getFlag(stdin, stdinKeys, "contents", mustBeString);
|
|
517
521
|
let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString);
|
|
518
522
|
let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString);
|
|
@@ -547,7 +551,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
|
|
|
547
551
|
}
|
|
548
552
|
function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) {
|
|
549
553
|
let flags = [];
|
|
550
|
-
let keys = Object.create(null);
|
|
554
|
+
let keys = /* @__PURE__ */ Object.create(null);
|
|
551
555
|
pushLogFlags(flags, options, keys, isTTY2, logLevelDefault);
|
|
552
556
|
pushCommonFlags(flags, options, keys);
|
|
553
557
|
let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean);
|
|
@@ -713,8 +717,8 @@ function createChannel(streamIn) {
|
|
|
713
717
|
if (isFirstPacket) {
|
|
714
718
|
isFirstPacket = false;
|
|
715
719
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
716
|
-
if (binaryVersion !== "0.14.
|
|
717
|
-
throw new Error(`Cannot start service: Host version "${"0.14.
|
|
720
|
+
if (binaryVersion !== "0.14.10") {
|
|
721
|
+
throw new Error(`Cannot start service: Host version "${"0.14.10"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
|
718
722
|
}
|
|
719
723
|
return;
|
|
720
724
|
}
|
|
@@ -763,7 +767,7 @@ function createChannel(streamIn) {
|
|
|
763
767
|
throw new Error('Cannot call "resolve" before plugin setup has completed');
|
|
764
768
|
if (typeof path3 !== "string")
|
|
765
769
|
throw new Error(`The path to resolve must be a string`);
|
|
766
|
-
let keys2 = Object.create(null);
|
|
770
|
+
let keys2 = /* @__PURE__ */ Object.create(null);
|
|
767
771
|
let pluginName = getFlag(options, keys2, "pluginName", mustBeString);
|
|
768
772
|
let importer = getFlag(options, keys2, "importer", mustBeString);
|
|
769
773
|
let namespace = getFlag(options, keys2, "namespace", mustBeString);
|
|
@@ -1747,7 +1751,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
|
1747
1751
|
}
|
|
1748
1752
|
}
|
|
1749
1753
|
var _a;
|
|
1750
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.
|
|
1754
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.10";
|
|
1751
1755
|
var esbuildCommandAndArgs = () => {
|
|
1752
1756
|
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
|
1753
1757
|
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.
|
|
@@ -1806,7 +1810,7 @@ var fsAsync = {
|
|
|
1806
1810
|
}
|
|
1807
1811
|
}
|
|
1808
1812
|
};
|
|
1809
|
-
var version = "0.14.
|
|
1813
|
+
var version = "0.14.10";
|
|
1810
1814
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1811
1815
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
|
1812
1816
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -1915,7 +1919,7 @@ var ensureServiceIsRunning = () => {
|
|
|
1915
1919
|
if (longLivedService)
|
|
1916
1920
|
return longLivedService;
|
|
1917
1921
|
let [command, args] = esbuildCommandAndArgs();
|
|
1918
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.14.
|
|
1922
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.14.10"}`, "--ping"), {
|
|
1919
1923
|
windowsHide: true,
|
|
1920
1924
|
stdio: ["pipe", "pipe", "inherit"],
|
|
1921
1925
|
cwd: defaultWD
|
|
@@ -2024,7 +2028,7 @@ var runServiceSync = (callback) => {
|
|
|
2024
2028
|
esbuild: node_exports
|
|
2025
2029
|
});
|
|
2026
2030
|
callback(service);
|
|
2027
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.
|
|
2031
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.10"}`), {
|
|
2028
2032
|
cwd: defaultWD,
|
|
2029
2033
|
windowsHide: true,
|
|
2030
2034
|
input: stdin,
|
|
@@ -2040,7 +2044,7 @@ var workerThreadService = null;
|
|
|
2040
2044
|
var startWorkerThreadService = (worker_threads2) => {
|
|
2041
2045
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
2042
2046
|
let worker = new worker_threads2.Worker(__filename, {
|
|
2043
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.
|
|
2047
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.10" },
|
|
2044
2048
|
transferList: [workerPort],
|
|
2045
2049
|
execArgv: []
|
|
2046
2050
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esbuild",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.10",
|
|
4
4
|
"description": "An extremely fast JavaScript and CSS bundler and minifier.",
|
|
5
5
|
"repository": "https://github.com/evanw/esbuild",
|
|
6
6
|
"scripts": {
|
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
"esbuild": "bin/esbuild"
|
|
13
13
|
},
|
|
14
14
|
"optionalDependencies": {
|
|
15
|
-
"esbuild-android-arm64": "0.14.
|
|
16
|
-
"esbuild-darwin-64": "0.14.
|
|
17
|
-
"esbuild-darwin-arm64": "0.14.
|
|
18
|
-
"esbuild-freebsd-64": "0.14.
|
|
19
|
-
"esbuild-freebsd-arm64": "0.14.
|
|
20
|
-
"esbuild-linux-32": "0.14.
|
|
21
|
-
"esbuild-linux-64": "0.14.
|
|
22
|
-
"esbuild-linux-arm": "0.14.
|
|
23
|
-
"esbuild-linux-arm64": "0.14.
|
|
24
|
-
"esbuild-linux-mips64le": "0.14.
|
|
25
|
-
"esbuild-linux-ppc64le": "0.14.
|
|
26
|
-
"esbuild-linux-s390x": "0.14.
|
|
27
|
-
"esbuild-netbsd-64": "0.14.
|
|
28
|
-
"esbuild-openbsd-64": "0.14.
|
|
29
|
-
"esbuild-sunos-64": "0.14.
|
|
30
|
-
"esbuild-windows-32": "0.14.
|
|
31
|
-
"esbuild-windows-64": "0.14.
|
|
32
|
-
"esbuild-windows-arm64": "0.14.
|
|
15
|
+
"esbuild-android-arm64": "0.14.10",
|
|
16
|
+
"esbuild-darwin-64": "0.14.10",
|
|
17
|
+
"esbuild-darwin-arm64": "0.14.10",
|
|
18
|
+
"esbuild-freebsd-64": "0.14.10",
|
|
19
|
+
"esbuild-freebsd-arm64": "0.14.10",
|
|
20
|
+
"esbuild-linux-32": "0.14.10",
|
|
21
|
+
"esbuild-linux-64": "0.14.10",
|
|
22
|
+
"esbuild-linux-arm": "0.14.10",
|
|
23
|
+
"esbuild-linux-arm64": "0.14.10",
|
|
24
|
+
"esbuild-linux-mips64le": "0.14.10",
|
|
25
|
+
"esbuild-linux-ppc64le": "0.14.10",
|
|
26
|
+
"esbuild-linux-s390x": "0.14.10",
|
|
27
|
+
"esbuild-netbsd-64": "0.14.10",
|
|
28
|
+
"esbuild-openbsd-64": "0.14.10",
|
|
29
|
+
"esbuild-sunos-64": "0.14.10",
|
|
30
|
+
"esbuild-windows-32": "0.14.10",
|
|
31
|
+
"esbuild-windows-64": "0.14.10",
|
|
32
|
+
"esbuild-windows-arm64": "0.14.10"
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT"
|
|
35
35
|
}
|