hswaw/site: load leaflet from NPM package
Instead of manually packaging leaflet.js into the Git repository, this
uses an http_archive to download it on demand, and augments the static
serving code to accept different regexes as paths so that the
http_archive's contents can be served directly.
Change-Id: Icb8d624fea855fb748f107471133ac8adb5f2776
diff --git a/WORKSPACE b/WORKSPACE
index 5c987ff..9370030 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -276,6 +276,28 @@
build_file = "@hscloud//third_party/jq:BUILD.external",
)
+# leaflet.js from NPM, used by //hswaw/site.
+http_archive(
+ name = "com_npmjs_leaflet",
+ urls = ["https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz"],
+ sha256 = "43aca726165904ff73a34571c263b561cec94e6b9992a4414a600f3e984d1b03",
+ build_file_content = """
+filegroup(
+ name = "distfiles",
+ srcs = [
+ "package/dist/leaflet.js",
+ "package/dist/leaflet.css",
+ "package/dist/images/layers-2x.png",
+ "package/dist/images/layers.png",
+ "package/dist/images/marker-icon-2x.png",
+ "package/dist/images/marker-icon.png",
+ "package/dist/images/marker-shadow.png",
+ ],
+ visibility = ["//visibility:public"],
+)
+""",
+)
+
go_repository(
name = "com_github_gorilla_sessions",
importpath = "github.com/gorilla/sessions",