esbuild 0.14.8 → 0.14.12
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 +5 -0
- package/lib/main.js +20 -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.12") {
|
|
97
|
+
throw new Error(`Expected ${JSON.stringify("0.14.12")} 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.12"}`, { 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.12"}.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 */
|
|
@@ -288,6 +290,7 @@ export interface PluginBuild {
|
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
export interface ResolveOptions {
|
|
293
|
+
pluginName?: string;
|
|
291
294
|
importer?: string;
|
|
292
295
|
namespace?: string;
|
|
293
296
|
resolveDir?: string;
|
|
@@ -446,7 +449,9 @@ export interface AnalyzeMetafileOptions {
|
|
|
446
449
|
* Documentation: https://esbuild.github.io/api/#build-api
|
|
447
450
|
*/
|
|
448
451
|
export declare function build(options: BuildOptions & { write: false }): Promise<BuildResult & { outputFiles: OutputFile[] }>;
|
|
452
|
+
export declare function build(options: BuildOptions & { incremental: true, metafile: true }): Promise<BuildIncremental & { metafile: Metafile }>;
|
|
449
453
|
export declare function build(options: BuildOptions & { incremental: true }): Promise<BuildIncremental>;
|
|
454
|
+
export declare function build(options: BuildOptions & { metafile: true }): Promise<BuildResult & { metafile: Metafile }>;
|
|
450
455
|
export declare function build(options: BuildOptions): Promise<BuildResult>;
|
|
451
456
|
|
|
452
457
|
/**
|
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.12") {
|
|
721
|
+
throw new Error(`Cannot start service: Host version "${"0.14.12"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
|
718
722
|
}
|
|
719
723
|
return;
|
|
720
724
|
}
|
|
@@ -763,7 +767,8 @@ 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);
|
|
771
|
+
let pluginName = getFlag(options, keys2, "pluginName", mustBeString);
|
|
767
772
|
let importer = getFlag(options, keys2, "importer", mustBeString);
|
|
768
773
|
let namespace = getFlag(options, keys2, "namespace", mustBeString);
|
|
769
774
|
let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString);
|
|
@@ -777,6 +782,8 @@ function createChannel(streamIn) {
|
|
|
777
782
|
key: buildKey,
|
|
778
783
|
pluginName: name
|
|
779
784
|
};
|
|
785
|
+
if (pluginName != null)
|
|
786
|
+
request.pluginName = pluginName;
|
|
780
787
|
if (importer != null)
|
|
781
788
|
request.importer = importer;
|
|
782
789
|
if (namespace != null)
|
|
@@ -1744,7 +1751,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
|
1744
1751
|
}
|
|
1745
1752
|
}
|
|
1746
1753
|
var _a;
|
|
1747
|
-
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.12";
|
|
1748
1755
|
var esbuildCommandAndArgs = () => {
|
|
1749
1756
|
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
|
1750
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.
|
|
@@ -1803,7 +1810,7 @@ var fsAsync = {
|
|
|
1803
1810
|
}
|
|
1804
1811
|
}
|
|
1805
1812
|
};
|
|
1806
|
-
var version = "0.14.
|
|
1813
|
+
var version = "0.14.12";
|
|
1807
1814
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1808
1815
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
|
1809
1816
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -1912,7 +1919,7 @@ var ensureServiceIsRunning = () => {
|
|
|
1912
1919
|
if (longLivedService)
|
|
1913
1920
|
return longLivedService;
|
|
1914
1921
|
let [command, args] = esbuildCommandAndArgs();
|
|
1915
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.14.
|
|
1922
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.14.12"}`, "--ping"), {
|
|
1916
1923
|
windowsHide: true,
|
|
1917
1924
|
stdio: ["pipe", "pipe", "inherit"],
|
|
1918
1925
|
cwd: defaultWD
|
|
@@ -2021,7 +2028,7 @@ var runServiceSync = (callback) => {
|
|
|
2021
2028
|
esbuild: node_exports
|
|
2022
2029
|
});
|
|
2023
2030
|
callback(service);
|
|
2024
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.
|
|
2031
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.12"}`), {
|
|
2025
2032
|
cwd: defaultWD,
|
|
2026
2033
|
windowsHide: true,
|
|
2027
2034
|
input: stdin,
|
|
@@ -2037,7 +2044,7 @@ var workerThreadService = null;
|
|
|
2037
2044
|
var startWorkerThreadService = (worker_threads2) => {
|
|
2038
2045
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
2039
2046
|
let worker = new worker_threads2.Worker(__filename, {
|
|
2040
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.
|
|
2047
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.12" },
|
|
2041
2048
|
transferList: [workerPort],
|
|
2042
2049
|
execArgv: []
|
|
2043
2050
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esbuild",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.12",
|
|
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.12",
|
|
16
|
+
"esbuild-darwin-64": "0.14.12",
|
|
17
|
+
"esbuild-darwin-arm64": "0.14.12",
|
|
18
|
+
"esbuild-freebsd-64": "0.14.12",
|
|
19
|
+
"esbuild-freebsd-arm64": "0.14.12",
|
|
20
|
+
"esbuild-linux-32": "0.14.12",
|
|
21
|
+
"esbuild-linux-64": "0.14.12",
|
|
22
|
+
"esbuild-linux-arm": "0.14.12",
|
|
23
|
+
"esbuild-linux-arm64": "0.14.12",
|
|
24
|
+
"esbuild-linux-mips64le": "0.14.12",
|
|
25
|
+
"esbuild-linux-ppc64le": "0.14.12",
|
|
26
|
+
"esbuild-linux-s390x": "0.14.12",
|
|
27
|
+
"esbuild-netbsd-64": "0.14.12",
|
|
28
|
+
"esbuild-openbsd-64": "0.14.12",
|
|
29
|
+
"esbuild-sunos-64": "0.14.12",
|
|
30
|
+
"esbuild-windows-32": "0.14.12",
|
|
31
|
+
"esbuild-windows-64": "0.14.12",
|
|
32
|
+
"esbuild-windows-arm64": "0.14.12"
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT"
|
|
35
35
|
}
|