diff --git a/CHANGELOG.md b/CHANGELOG.md index 02a20480a3f..24e0a92db15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +* Fix binary downloads from the `@esbuild/` scope for Deno ([#2729](https://github.com/evanw/esbuild/issues/2729)) + + Version 0.16.0 of esbuild moved esbuild's binary executables into npm packages under the `@esbuild/` scope, which accidentally broke the binary downloader script for Deno. This release fixes this script so it should now be possible to use esbuild version 0.16.4+ with Deno. + ## 0.16.3 * Fix a hang with the JS API in certain cases ([#2727](https://github.com/evanw/esbuild/issues/2727)) diff --git a/lib/deno/mod.ts b/lib/deno/mod.ts index 19a7aafc559..68fd848e560 100644 --- a/lib/deno/mod.ts +++ b/lib/deno/mod.ts @@ -67,7 +67,7 @@ async function installFromNPM(name: string, subpath: string): Promise { } catch (e) { } - const url = `https://registry.npmjs.org/${name}/-/${name}-${version}.tgz` + const url = `https://registry.npmjs.org/${name}/-/${name.replace('@esbuild/', '')}-${version}.tgz` const buffer = await fetch(url).then(r => r.arrayBuffer()) const executable = extractFileFromTarGzip(new Uint8Array(buffer), subpath) @@ -112,7 +112,7 @@ function getCachePath(name: string): { finalPath: string, finalDir: string } { if (!baseDir) throw new Error('Failed to find cache directory') const finalDir = baseDir + `/esbuild/bin` - const finalPath = finalDir + `/${name}@${version}` + const finalPath = finalDir + `/${name.replace('/', '-')}@${version}` return { finalPath, finalDir } }