Revert "build: update integration/bazel to rules_nodejs 0.42.1" (#34360)
This reverts commit ec7ea77aa8d90d2ba32089e140ed716cb6aadb89 because it's part of a PR that was red on CircleCI once it was merged into master (Windows tests are only run on master, not on PRs). PR Close #34360
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
|
||||
load("@npm//html-insert-assets:index.bzl", "html_insert_assets")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("@npm_angular_bazel//:index.bzl", "ng_module")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
|
||||
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
|
||||
load("@npm_bazel_terser//:index.bzl", "terser_minified")
|
||||
load("@npm_bazel_typescript//:index.bzl", "ts_devserver")
|
||||
@ -35,46 +34,15 @@ filegroup(
|
||||
],
|
||||
)
|
||||
|
||||
html_insert_assets(
|
||||
name = "inject_scripts",
|
||||
# We can't output "index.html" since that collides with the input file.
|
||||
# We output "_/index.html" instead ond remap in ts_devserver & pkg_web
|
||||
# using additional_root_paths.
|
||||
outs = ["_/index.html"],
|
||||
args = [
|
||||
"--html",
|
||||
"$(location :index.html)",
|
||||
"--out",
|
||||
"$@",
|
||||
"--assets",
|
||||
# We load zone.js outside the bundle. That's because it's a "pollyfill"
|
||||
# which speculates that such features might be available in a browser.
|
||||
# Also it's tricky to configure dead code elimination to understand that
|
||||
# zone.js is used, given that we don't have any import statement that
|
||||
# imports from it.
|
||||
"$(location @npm//:node_modules/zone.js/dist/zone.min.js)",
|
||||
# Bundle path for both prodapp & devserver
|
||||
"bundle.min.js",
|
||||
],
|
||||
data = [
|
||||
":index.html",
|
||||
"@npm//:node_modules/zone.js/dist/zone.min.js",
|
||||
],
|
||||
)
|
||||
|
||||
ts_devserver(
|
||||
name = "devserver",
|
||||
# Remap "_/index.html" => "index.html"
|
||||
additional_root_paths = ["src/_"],
|
||||
entry_module = "bazel_integration_test/src/main",
|
||||
index_html = "index.html",
|
||||
scripts = [
|
||||
":rxjs_umd_modules",
|
||||
],
|
||||
# Use the same bundle serving path as prodserver so that we can share
|
||||
# an index.html file.
|
||||
serving_path = "/bundle.min.js",
|
||||
static_files = [
|
||||
":inject_scripts",
|
||||
"@npm//:node_modules/zone.js/dist/zone.min.js",
|
||||
],
|
||||
deps = ["//src"],
|
||||
@ -96,15 +64,14 @@ terser_minified(
|
||||
src = ":bundle",
|
||||
)
|
||||
|
||||
pkg_web(
|
||||
web_package(
|
||||
name = "prodapp",
|
||||
srcs = [
|
||||
":bundle.min",
|
||||
":inject_scripts",
|
||||
assets = [
|
||||
# do not sort
|
||||
"@npm//:node_modules/zone.js/dist/zone.min.js",
|
||||
":bundle.min",
|
||||
],
|
||||
# Remap "_/index.html" => "index.html"
|
||||
additional_root_paths = ["src/_"],
|
||||
index_html = "index.html",
|
||||
)
|
||||
|
||||
http_server(
|
||||
|
Reference in New Issue
Block a user