build(ivy): make sure animation_world prodserver and devserver work as expected (#32778)

PR Close #32778
This commit is contained in:
Matias Niemelä 2019-09-19 14:11:44 -07:00 committed by Andrew Kushnir
parent 04ddcfecd8
commit 7a00c676ec
2 changed files with 27 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle") load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle")
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server") load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver")
ng_module( ng_module(
name = "animation_world", name = "animation_world",
@ -30,8 +31,32 @@ ng_rollup_bundle(
], ],
) )
http_server( ts_devserver(
name = "devserver", name = "devserver",
additional_root_paths = [
"npm/node_modules/tslib",
],
entry_module = "@angular/core/test/bundling/animation_world",
scripts = [
"//tools/rxjs:rxjs_umd_modules",
],
# Use a serving_path that matches the common static index.html used
# in both devserver & prodserver
serving_path = "/bundle.min.js.br",
static_files = [
"animation_world.css",
"base.css",
"index.html",
"@npm//tslib",
],
tags = [
"ivy-only",
],
deps = [":animation_world"],
)
http_server(
name = "prodserver",
data = [ data = [
"animation_world.css", "animation_world.css",
"base.css", "base.css",

View File

@ -25,7 +25,7 @@
--> -->
<script> <script>
document.write('<script src="' + document.write('<script src="' +
(document.location.search.endsWith('debug') ? '/bundle.min_debug.js' : '/bundle.min.js') + (document.location.search.endsWith('debug') ? '/bundle.min_debug.js' : '/bundle.min.js.br') +
'"></' + 'script>'); '"></' + 'script>');
</script> </script>
</body> </body>