blob: 0d5cc64783f00ca8cf4cef64262f4be9e85f006c [file] [log] [blame]
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver", "ts_library")
ts_library(
name = "app",
srcs = ["app.ts"],
)
ts_devserver(
name = "devserver",
port = 8080,
# This is the path we'll request from the browser, see index.html
serving_path = "/bundle.min.js",
# The devserver can serve our static files too
static_files = ["index.html"],
# We'll collect all the devmode JS sources from these TypeScript libraries
deps = [":app"],
)
# Test for production mode
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "rollup_bundle")
rollup_bundle(
name = "bundle",
entry_point = "examples/app/app",
deps = [":app"],
)
nodejs_binary(
name = "prodserver",
args = ["./examples/app"],
data = [
"index.html",
":bundle",
],
entry_point = "http-server/bin/http-server",
)
ts_library(
name = "e2e",
testonly = 1,
srcs = ["app_e2e_test.ts"],
)