esbuild 0.15.15 → 0.15.16

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 CHANGED
@@ -190,7 +190,7 @@ for your current platform.`);
190
190
  "node_modules",
191
191
  ".cache",
192
192
  "esbuild",
193
- `pnpapi-${pkg}-${"0.15.15"}-${path.basename(subpath)}`
193
+ `pnpapi-${pkg}-${"0.15.16"}-${path.basename(subpath)}`
194
194
  );
195
195
  if (!fs.existsSync(binTargetPath)) {
196
196
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/install.js CHANGED
@@ -90,8 +90,8 @@ function validateBinaryVersion(...command) {
90
90
  const stdout = child_process.execFileSync(command.shift(), command, {
91
91
  stdio: "pipe"
92
92
  }).toString().trim();
93
- if (stdout !== "0.15.15") {
94
- throw new Error(`Expected ${JSON.stringify("0.15.15")} but got ${JSON.stringify(stdout)}`);
93
+ if (stdout !== "0.15.16") {
94
+ throw new Error(`Expected ${JSON.stringify("0.15.16")} but got ${JSON.stringify(stdout)}`);
95
95
  }
96
96
  }
97
97
  function isYarn() {
@@ -143,7 +143,7 @@ function installUsingNPM(pkg, subpath, binPath) {
143
143
  try {
144
144
  fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
145
145
  child_process.execSync(
146
- `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.15.15"}`,
146
+ `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.15.16"}`,
147
147
  { cwd: installDir, stdio: "pipe", env }
148
148
  );
149
149
  const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
@@ -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.15.15"}.tgz`;
197
+ const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.15.16"}.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
@@ -98,6 +98,8 @@ export interface BuildOptions extends CommonOptions {
98
98
  outbase?: string;
99
99
  /** Documentation: https://esbuild.github.io/api/#external */
100
100
  external?: string[];
101
+ /** Documentation: https://esbuild.github.io/api/#alias */
102
+ alias?: Record<string, string>;
101
103
  /** Documentation: https://esbuild.github.io/api/#loader */
102
104
  loader?: { [ext: string]: Loader };
103
105
  /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
package/lib/main.js CHANGED
@@ -420,6 +420,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
420
420
  let mainFields = getFlag(options, keys, "mainFields", mustBeArray);
421
421
  let conditions = getFlag(options, keys, "conditions", mustBeArray);
422
422
  let external = getFlag(options, keys, "external", mustBeArray);
423
+ let alias = getFlag(options, keys, "alias", mustBeObject);
423
424
  let loader = getFlag(options, keys, "loader", mustBeObject);
424
425
  let outExtension = getFlag(options, keys, "outExtension", mustBeObject);
425
426
  let publicPath = getFlag(options, keys, "publicPath", mustBeString);
@@ -510,6 +511,13 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
510
511
  if (external)
511
512
  for (let name of external)
512
513
  flags.push(`--external:${name}`);
514
+ if (alias) {
515
+ for (let old in alias) {
516
+ if (old.indexOf("=") >= 0)
517
+ throw new Error(`Invalid package name in alias: ${old}`);
518
+ flags.push(`--alias:${old}=${alias[old]}`);
519
+ }
520
+ }
513
521
  if (banner) {
514
522
  for (let type in banner) {
515
523
  if (type.indexOf("=") >= 0)
@@ -709,8 +717,8 @@ function createChannel(streamIn) {
709
717
  if (isFirstPacket) {
710
718
  isFirstPacket = false;
711
719
  let binaryVersion = String.fromCharCode(...bytes);
712
- if (binaryVersion !== "0.15.15") {
713
- throw new Error(`Cannot start service: Host version "${"0.15.15"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
720
+ if (binaryVersion !== "0.15.16") {
721
+ throw new Error(`Cannot start service: Host version "${"0.15.16"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
714
722
  }
715
723
  return;
716
724
  }
@@ -1830,7 +1838,7 @@ for your current platform.`);
1830
1838
  "node_modules",
1831
1839
  ".cache",
1832
1840
  "esbuild",
1833
- `pnpapi-${pkg}-${"0.15.15"}-${path.basename(subpath)}`
1841
+ `pnpapi-${pkg}-${"0.15.16"}-${path.basename(subpath)}`
1834
1842
  );
1835
1843
  if (!fs.existsSync(binTargetPath)) {
1836
1844
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1862,7 +1870,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1862
1870
  }
1863
1871
  }
1864
1872
  var _a;
1865
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.15.15";
1873
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.15.16";
1866
1874
  var esbuildCommandAndArgs = () => {
1867
1875
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1868
1876
  throw new Error(
@@ -1929,7 +1937,7 @@ var fsAsync = {
1929
1937
  }
1930
1938
  }
1931
1939
  };
1932
- var version = "0.15.15";
1940
+ var version = "0.15.16";
1933
1941
  var build = (options) => ensureServiceIsRunning().build(options);
1934
1942
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1935
1943
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2040,7 +2048,7 @@ var ensureServiceIsRunning = () => {
2040
2048
  if (longLivedService)
2041
2049
  return longLivedService;
2042
2050
  let [command, args] = esbuildCommandAndArgs();
2043
- let child = child_process.spawn(command, args.concat(`--service=${"0.15.15"}`, "--ping"), {
2051
+ let child = child_process.spawn(command, args.concat(`--service=${"0.15.16"}`, "--ping"), {
2044
2052
  windowsHide: true,
2045
2053
  stdio: ["pipe", "pipe", "inherit"],
2046
2054
  cwd: defaultWD
@@ -2154,7 +2162,7 @@ var runServiceSync = (callback) => {
2154
2162
  esbuild: node_exports
2155
2163
  });
2156
2164
  callback(service);
2157
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.15.15"}`), {
2165
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.15.16"}`), {
2158
2166
  cwd: defaultWD,
2159
2167
  windowsHide: true,
2160
2168
  input: stdin,
@@ -2170,7 +2178,7 @@ var workerThreadService = null;
2170
2178
  var startWorkerThreadService = (worker_threads2) => {
2171
2179
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2172
2180
  let worker = new worker_threads2.Worker(__filename, {
2173
- workerData: { workerPort, defaultWD, esbuildVersion: "0.15.15" },
2181
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.15.16" },
2174
2182
  transferList: [workerPort],
2175
2183
  execArgv: []
2176
2184
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.15.15",
3
+ "version": "0.15.16",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "scripts": {
@@ -15,28 +15,28 @@
15
15
  "esbuild": "bin/esbuild"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@esbuild/android-arm": "0.15.15",
19
- "@esbuild/linux-loong64": "0.15.15",
20
- "esbuild-android-64": "0.15.15",
21
- "esbuild-android-arm64": "0.15.15",
22
- "esbuild-darwin-64": "0.15.15",
23
- "esbuild-darwin-arm64": "0.15.15",
24
- "esbuild-freebsd-64": "0.15.15",
25
- "esbuild-freebsd-arm64": "0.15.15",
26
- "esbuild-linux-32": "0.15.15",
27
- "esbuild-linux-64": "0.15.15",
28
- "esbuild-linux-arm": "0.15.15",
29
- "esbuild-linux-arm64": "0.15.15",
30
- "esbuild-linux-mips64le": "0.15.15",
31
- "esbuild-linux-ppc64le": "0.15.15",
32
- "esbuild-linux-riscv64": "0.15.15",
33
- "esbuild-linux-s390x": "0.15.15",
34
- "esbuild-netbsd-64": "0.15.15",
35
- "esbuild-openbsd-64": "0.15.15",
36
- "esbuild-sunos-64": "0.15.15",
37
- "esbuild-windows-32": "0.15.15",
38
- "esbuild-windows-64": "0.15.15",
39
- "esbuild-windows-arm64": "0.15.15"
18
+ "@esbuild/android-arm": "0.15.16",
19
+ "@esbuild/linux-loong64": "0.15.16",
20
+ "esbuild-android-64": "0.15.16",
21
+ "esbuild-android-arm64": "0.15.16",
22
+ "esbuild-darwin-64": "0.15.16",
23
+ "esbuild-darwin-arm64": "0.15.16",
24
+ "esbuild-freebsd-64": "0.15.16",
25
+ "esbuild-freebsd-arm64": "0.15.16",
26
+ "esbuild-linux-32": "0.15.16",
27
+ "esbuild-linux-64": "0.15.16",
28
+ "esbuild-linux-arm": "0.15.16",
29
+ "esbuild-linux-arm64": "0.15.16",
30
+ "esbuild-linux-mips64le": "0.15.16",
31
+ "esbuild-linux-ppc64le": "0.15.16",
32
+ "esbuild-linux-riscv64": "0.15.16",
33
+ "esbuild-linux-s390x": "0.15.16",
34
+ "esbuild-netbsd-64": "0.15.16",
35
+ "esbuild-openbsd-64": "0.15.16",
36
+ "esbuild-sunos-64": "0.15.16",
37
+ "esbuild-windows-32": "0.15.16",
38
+ "esbuild-windows-64": "0.15.16",
39
+ "esbuild-windows-arm64": "0.15.16"
40
40
  },
41
41
  "license": "MIT"
42
42
  }