blob: 24d6919d0b3092e7bbed4991b823ab7890ea96cf [file]
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle")
# TODO(alexeagle): promote web_package rule to the public API
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
rollup_bundle(
name = "bundle",
srcs = glob(["*.js"]),
entry_point = ":index.js",
)
web_package(
name = "package",
assets = [
# For differential loading, we supply both an ESModule entry point and an es5 entry point
# The injector will put two complimentary script tags in the index.html
":bundle.min.js",
":bundle.min.es2015.js",
"styles.css",
],
data = ["favicon.png"],
index_html = "index.html",
)
http_server(
name = "server",
data = [":package"],
templated_args = ["package"],
)