2021-09-08 18:39:40 -04:00
|
|
|
load("@npm//html-insert-assets:index.bzl", "html_insert_assets")
|
2021-11-07 18:57:52 -05:00
|
|
|
load("//tools:angular_ts_project.bzl", "ng_ts_project")
|
2021-11-21 18:19:47 -05:00
|
|
|
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
|
2021-09-08 18:39:40 -04:00
|
|
|
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
|
2021-11-07 18:57:52 -05:00
|
|
|
load("@npm//history-server:index.bzl", "history_server")
|
|
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
|
2021-09-08 18:39:40 -04:00
|
|
|
|
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
|
|
|
|
|
sass_library(
|
|
|
|
|
name = "material-theming",
|
2021-11-21 18:19:47 -05:00
|
|
|
srcs = ["@npm//:node_modules/@angular/material/_index.scss"],
|
2021-09-08 18:39:40 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
sass_binary(
|
|
|
|
|
name = "demo-styles",
|
|
|
|
|
src = "styles.scss",
|
|
|
|
|
sourcemap = False,
|
2021-11-21 18:19:47 -05:00
|
|
|
deps = [":material-theming"],
|
2021-09-08 18:39:40 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
_ASSETS = [
|
|
|
|
|
"//src:demo-styles",
|
|
|
|
|
"@npm//:node_modules/zone.js/dist/zone.min.js",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
html_insert_assets(
|
|
|
|
|
name = "inject_scripts_for_dev",
|
|
|
|
|
outs = ["index.html"],
|
|
|
|
|
args = [
|
|
|
|
|
"--html=$(execpath //src:_index.html)",
|
|
|
|
|
"--out=$@",
|
|
|
|
|
"--roots=. $(RULEDIR)",
|
|
|
|
|
"--assets",
|
|
|
|
|
] + ["$(execpath %s)" % s for s in _ASSETS] + [
|
2021-11-07 18:57:52 -05:00
|
|
|
"--scripts --module $(execpath :bundle-es2015)/index.dev.js",
|
2021-09-08 18:39:40 -04:00
|
|
|
],
|
2021-11-07 18:57:52 -05:00
|
|
|
data = [
|
|
|
|
|
"//src:_index.html",
|
|
|
|
|
":bundle-es2015",
|
|
|
|
|
] + _ASSETS,
|
2021-09-08 18:39:40 -04:00
|
|
|
)
|
|
|
|
|
|
2021-11-07 18:57:52 -05:00
|
|
|
ng_ts_project(
|
2021-09-08 18:39:40 -04:00
|
|
|
name = "demo",
|
|
|
|
|
srcs = ["main.ts"],
|
2021-11-21 18:19:47 -05:00
|
|
|
tsconfig = "//:tsconfig.json",
|
2021-09-08 18:39:40 -04:00
|
|
|
deps = [
|
|
|
|
|
"//src/app",
|
2021-11-21 18:19:47 -05:00
|
|
|
"//src/environments",
|
2021-09-08 18:39:40 -04:00
|
|
|
"@npm//@angular/common",
|
2021-11-21 18:19:47 -05:00
|
|
|
"@npm//@angular/core",
|
2021-09-08 18:39:40 -04:00
|
|
|
"@npm//@angular/platform-browser",
|
2021-11-21 18:19:47 -05:00
|
|
|
"@npm//@angular/platform-browser-dynamic",
|
2021-09-08 18:39:40 -04:00
|
|
|
"@npm//@types",
|
2021-11-21 18:19:47 -05:00
|
|
|
"@npm//rxjs",
|
2021-09-08 18:39:40 -04:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2021-11-07 18:57:52 -05:00
|
|
|
ng_ts_project(
|
2021-09-08 18:39:40 -04:00
|
|
|
name = "demo-application-environment",
|
|
|
|
|
srcs = ["demo-application-environment.ts"],
|
|
|
|
|
deps = [
|
|
|
|
|
"//projects/ng-devtools",
|
2021-11-21 18:19:47 -05:00
|
|
|
"//src/environments",
|
2021-09-08 18:39:40 -04:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2021-11-07 18:57:52 -05:00
|
|
|
ng_ts_project(
|
2021-09-08 18:39:40 -04:00
|
|
|
name = "demo-application-operations",
|
|
|
|
|
srcs = ["demo-application-operations.ts"],
|
|
|
|
|
deps = [
|
2021-11-21 18:19:47 -05:00
|
|
|
"//projects/ng-devtools",
|
2021-09-08 18:39:40 -04:00
|
|
|
"//projects/protocol",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2021-11-07 18:57:52 -05:00
|
|
|
ng_ts_project(
|
2021-09-08 18:39:40 -04:00
|
|
|
name = "iframe-message-bus",
|
|
|
|
|
srcs = ["iframe-message-bus.ts"],
|
|
|
|
|
deps = [
|
2021-11-21 18:19:47 -05:00
|
|
|
"//projects/protocol",
|
|
|
|
|
],
|
2021-09-08 18:39:40 -04:00
|
|
|
)
|
|
|
|
|
|
2021-11-07 18:57:52 -05:00
|
|
|
ng_ts_project(
|
2021-09-08 18:39:40 -04:00
|
|
|
name = "zone-unaware-iframe-message-bus",
|
|
|
|
|
srcs = ["zone-unaware-iframe-message-bus.ts"],
|
|
|
|
|
deps = [
|
|
|
|
|
":iframe-message-bus",
|
2021-11-21 18:19:47 -05:00
|
|
|
"//projects/protocol",
|
|
|
|
|
],
|
2021-09-08 18:39:40 -04:00
|
|
|
)
|
2021-11-07 18:57:52 -05:00
|
|
|
|
|
|
|
|
rollup_bundle(
|
|
|
|
|
name = "bundle-es2015",
|
|
|
|
|
config_file = "rollup.config.js",
|
|
|
|
|
entry_points = {
|
|
|
|
|
":main.ts": "index.dev",
|
|
|
|
|
},
|
2021-11-21 18:19:47 -05:00
|
|
|
format = "esm",
|
2021-11-07 18:57:52 -05:00
|
|
|
output_dir = True,
|
|
|
|
|
deps = [
|
|
|
|
|
":demo",
|
|
|
|
|
"@npm//@rollup/plugin-commonjs",
|
|
|
|
|
"@npm//@rollup/plugin-node-resolve",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pkg_web(
|
|
|
|
|
name = "devapp",
|
|
|
|
|
srcs = _ASSETS + [
|
|
|
|
|
":bundle-es2015",
|
|
|
|
|
":inject_scripts_for_dev",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
history_server(
|
|
|
|
|
name = "devserver",
|
|
|
|
|
data = [":devapp"],
|
2021-11-21 18:19:47 -05:00
|
|
|
templated_args = [
|
|
|
|
|
"-a $$(rlocation $(rootpath :devapp))",
|
|
|
|
|
"--port 4200",
|
|
|
|
|
],
|
|
|
|
|
)
|