Skip to content

Instantly share code, notes, and snippets.

@sgammon
Created January 4, 2021 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgammon/02a249cc3a806f4b6f0a9a4da480a241 to your computer and use it in GitHub Desktop.
Save sgammon/02a249cc3a806f4b6f0a9a4da480a241 to your computer and use it in GitHub Desktop.
Sample worker
load(
"@elide//defs/toolchain/cloudflare:deploy.bzl",
"cloudflare_worker",
)
cloudflare_worker(
name = "<some_target_name>",
worker = "<worker_name>",
entrypoint = "entrypoint.js",
wasm = True,
rust_test = glob(["test_lib/*.rs"]),
js_test = "worker_wasm_js_test.js",
srcs = ["main.rs"],
deps = [
":worker_lib", # Rust library implementing the worker
],
data = [ # extra data for the final tarball
"Cargo.toml",
"Cargo.lock",
"metadata.json",
"package.json",
],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment