Skip to content

Commit

Permalink
fix #2729: esbuild should now work with deno again
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 10, 2022
1 parent b3231a8 commit 1fb0ee9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions 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))
Expand Down
4 changes: 2 additions & 2 deletions lib/deno/mod.ts
Expand Up @@ -67,7 +67,7 @@ async function installFromNPM(name: string, subpath: string): Promise<string> {
} 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)

Expand Down Expand Up @@ -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 }
}

Expand Down

0 comments on commit 1fb0ee9

Please sign in to comment.