Combine scouting webserver and scouting web pages
This patch adds a new `//scouting` target that runs the webserver and
points it at our web pages. This will be the target that folks can use
to run the entire scouting application.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I62acfb271b856f9d238b17ecc3573f31a07bab41
diff --git a/scouting/www/BUILD b/scouting/www/BUILD
index c22ea38..aa2ad7b 100644
--- a/scouting/www/BUILD
+++ b/scouting/www/BUILD
@@ -3,6 +3,10 @@
load("@npm//@bazel/concatjs:index.bzl", "concatjs_devserver")
load("@npm//@babel/cli:index.bzl", "babel")
+exports_files([
+ "index.html",
+])
+
ts_library(
name = "app",
srcs = glob([
@@ -46,14 +50,29 @@
"@npm//@angular/compiler-cli",
],
output_dir = True,
+ visibility = ["//visibility:public"],
+)
+
+# Create a copy of zone.js here so that we can have a predictable path to
+# source it from on the webserver.
+genrule(
+ name = "zonejs_copy",
+ srcs = [
+ "@npm//:node_modules/zone.js/dist/zone.min.js",
+ ],
+ outs = [
+ "npm/node_modules/zone.js/dist/zone.min.js",
+ ],
+ cmd = "cp $(SRCS) $(OUTS)",
+ visibility = ["//visibility:public"],
)
concatjs_devserver(
name = "devserver",
serving_path = "/main_bundle.js",
static_files = [
- ":index.html",
- "@npm//:node_modules/zone.js/dist/zone.min.js",
+ "index.html",
+ ":zonejs_copy",
],
deps = [":main_bundle_compiled"],
)