blob: 8c217c80b3644501a7ccb4b93d954db4d3cb71f7 [file] [log] [blame]
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
load("//:defs.bzl", "ts_devserver")
load("//internal:defaults.bzl", "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", "rollup_bundle", "nodejs_binary")
rollup_bundle(
name = "bundle",
entry_point = "examples/app/app",
deps = [":app"],
)
http_server(
name = "prodserver",
data = [
"index.html",
":bundle",
],
)
ts_library(
name = "e2e",
testonly = 1,
srcs = ["app_e2e_test.ts"],
tsconfig = "//examples:tsconfig-test",
deps = [
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//protractor",
],
)