Skip to content

Commit

Permalink
fix #936: announce deno support
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Apr 15, 2021
1 parent 32de4a0 commit 0b9456d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## Unreleased

* Initial support for Deno ([#936](https://github.com/evanw/esbuild/issues/936))

You can now use esbuild in the [Deno](https://deno.land/) JavaScript environment via esbuild's official Deno package. Using it looks something like this:

```js
import * as esbuild from 'https://deno.land/x/esbuild@v0.11.11/mod.js'
const ts = 'let hasProcess: boolean = typeof process != "null"'
const result = await esbuild.transform(ts, { loader: 'ts', logLevel: 'warning' })
console.log('result:', result)
esbuild.stop()
```

It has basically the same API as esbuild's npm package with one addition: you need to call `stop()` when you're done because unlike node, Deno doesn't provide the necessary APIs to allow Deno to exit while esbuild's internal child process is still running.

* Remove warnings about non-bundled use of `require` and `import` ([#1153](https://github.com/evanw/esbuild/issues/1153), [#1142](https://github.com/evanw/esbuild/issues/1142), [#1132](https://github.com/evanw/esbuild/issues/1132), [#1045](https://github.com/evanw/esbuild/issues/1045), [#812](https://github.com/evanw/esbuild/issues/812), [#661](https://github.com/evanw/esbuild/issues/661), [#574](https://github.com/evanw/esbuild/issues/574), [#512](https://github.com/evanw/esbuild/issues/512), [#495](https://github.com/evanw/esbuild/issues/495), [#480](https://github.com/evanw/esbuild/issues/480), [#453](https://github.com/evanw/esbuild/issues/453), [#410](https://github.com/evanw/esbuild/issues/410), [#80](https://github.com/evanw/esbuild/issues/80))

Previously esbuild had warnings when bundling about uses of `require` and `import` that are not of the form `require(<string literal>)` or `import(<string literal>)`. These warnings existed because the bundling process must be able to statically-analyze all dynamic imports to determine which files must be included. Here are some real-world examples of cases that esbuild doesn't statically analyze:
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ publish-all: cmd/esbuild/version.go test-prepublish
@echo Enter one-time password:
@read OTP && OTP="$$OTP" make -j2 \
publish-neutral \
publish-deno \
publish-wasm
git commit -am "publish $(ESBUILD_VERSION) to npm"
git tag "v$(ESBUILD_VERSION)"
Expand Down Expand Up @@ -257,6 +258,14 @@ publish-wasm: platform-wasm
publish-neutral: platform-neutral
test -n "$(OTP)" && cd npm/esbuild && npm publish --otp="$(OTP)"

publish-deno:
test -f deno/.git || (rm -fr deno && git clone git@github.com:esbuild/deno-esbuild.git deno)
cd deno && git fetch && git reset --hard origin/main
make platform-deno
cd deno && git commit -am "publish $(ESBUILD_VERSION) to deno"
cd deno && git tag "v$(ESBUILD_VERSION)"
cd deno && git push origin main "v$(ESBUILD_VERSION)"

clean:
rm -f esbuild
rm -f npm/esbuild-windows-32/esbuild.exe
Expand Down

0 comments on commit 0b9456d

Please sign in to comment.