Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow makefile addition to build Go wasip1 .wasm binary #3779

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ platform-unixlike: version-go
@test -n "$(GOARCH)" || (echo "The environment variable GOARCH must be provided" && false)
@test -n "$(NPMDIR)" || (echo "The environment variable NPMDIR must be provided" && false)
node scripts/esbuild.js "$(NPMDIR)/package.json" --version
CGO_ENABLED=0 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(NPMDIR)/bin/esbuild" ./cmd/esbuild
CGO_ENABLED=0 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(NPMDIR)/bin/esbuild$(EXTENSION)" ./cmd/esbuild

platform-android-x64: platform-wasm
node scripts/esbuild.js npm/@esbuild/android-x64/package.json --version
Expand Down Expand Up @@ -360,6 +360,9 @@ platform-netbsd-x64:
platform-openbsd-x64:
@$(MAKE) --no-print-directory GOOS=openbsd GOARCH=amd64 NPMDIR=npm/@esbuild/openbsd-x64 platform-unixlike

platform-wasip1:
@$(MAKE) --no-print-directory GOOS=wasip1 GOARCH=wasm NPMDIR=npm/@esbuild/wasip1-wasm platform-unixlike EXTENSION=.wasm

platform-linux-x64:
@$(MAKE) --no-print-directory GOOS=linux GOARCH=amd64 NPMDIR=npm/@esbuild/linux-x64 platform-unixlike

Expand Down
3 changes: 3 additions & 0 deletions npm/@esbuild/wasip1-wasm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# esbuild

This is the wasip1 WAPI wasm binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
20 changes: 20 additions & 0 deletions npm/@esbuild/wasip1-wasm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@esbuild/wasm-wapi",
"version": "0.21.3",
"description": "The wasip1 WAPI wasm binary for esbuild, a JavaScript bundler.",
"repository": {
"type": "git",
"url": "git+https://github.com/evanw/esbuild.git"
},
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
},
"os": [
"wasip1"
],
"cpu": [
"wasm"
]
}