load("@rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
    name = "wasm_lib",
    srcs = ["main.go"],
    importpath = "github.com/google/go-jsonnet/cmd/wasm",
    visibility = ["//visibility:private"],
    deps = select({
        "@rules_go//go/platform:js_wasm": [
            "//:go-jsonnet",
            "//internal/formatter",
        ],
        "//conditions:default": [],
    }),
)

go_binary(
    name = "libjsonnet.wasm",
    embed = [":wasm_lib"],
    goarch = "wasm",
    goos = "js",
    visibility = ["//visibility:public"],
)
