mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
45 lines
1.2 KiB
Text
45 lines
1.2 KiB
Text
load("@rules_angular//src/optimization:index.bzl", "optimize_angular_app")
|
|
load("//tools:defaults.bzl", "copy_to_bin", "http_server")
|
|
|
|
package(default_visibility = ["//modules/playground:__subpackages__"])
|
|
|
|
optimize_angular_app(
|
|
name = "bundles",
|
|
srcs = glob(["**/*.ts"]) + ["index.html"],
|
|
include_zonejs = True,
|
|
jq_config_filter = ".projects.boilerplate.architect.build.options.sourceMap.scripts = true",
|
|
deps = [
|
|
"//modules:node_modules/@angular/build",
|
|
"//modules:node_modules/@angular/common",
|
|
"//modules:node_modules/@angular/core",
|
|
"//modules:node_modules/@angular/platform-browser",
|
|
"//modules:node_modules/rxjs",
|
|
"//modules:node_modules/tslib",
|
|
"//modules:node_modules/zone.js",
|
|
],
|
|
)
|
|
|
|
# The script needs to be called `app_bundle` for easier syncing into g3.
|
|
genrule(
|
|
name = "app_bundle",
|
|
srcs = [":bundles"],
|
|
outs = ["app_bundle.js"],
|
|
cmd = "cp $</main.js $@",
|
|
)
|
|
|
|
http_server(
|
|
name = "devserver",
|
|
srcs = ["index.html"],
|
|
deps = [
|
|
":app_bundle",
|
|
"//modules:node_modules/zone.js",
|
|
],
|
|
)
|
|
|
|
copy_to_bin(
|
|
name = "assets",
|
|
srcs = [
|
|
"main.ts",
|
|
":bundles",
|
|
],
|
|
)
|