Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 706 Bytes

File metadata and controls

13 lines (8 loc) · 706 Bytes

webdyff

A thin wrapper for dyff that builds a WebAssembly binary and provides a static webpage to run the diff with basic syntax highlighting, available here.

Build

      GOOS=js GOARCH=wasm go build -trimpath -ldflags="-s -w" -o web/app.wasm ./cmd/wasm
      cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" web/wasm_exec.js

The /web directory will contain all the necessary files to deploy to any static site hosting.

The binary can be further optimized with wasm-opt, if desired:

      wasm-opt -Oz web/app.wasm -o web/app.wasm --all-features