Skip to content

Commit

Permalink
Revert "build: update integration/bazel to rules_nodejs 0.42.1" (#34360)
Browse files Browse the repository at this point in the history
This reverts commit ec7ea77 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
  • Loading branch information
kara committed Dec 11, 2019
1 parent 9a800e8 commit ad98702
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 276 deletions.
4 changes: 2 additions & 2 deletions integration/bazel/WORKSPACE
Expand Up @@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "c612d6b76eaa17540e8b8c806e02701ed38891460f9ba3303f4424615437887a",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.42.1/rules_nodejs-0.42.1.tar.gz"],
sha256 = "9901bc17138a79135048fb0c107ee7a56e91815ec6594c08cb9a17b80276d62b",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.40.0/rules_nodejs-0.40.0.tar.gz"],
)

# Fetch sass rules for compiling sass files
Expand Down
19 changes: 5 additions & 14 deletions integration/bazel/package.json
Expand Up @@ -23,22 +23,13 @@
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@bazel/bazel": "file:../../node_modules/@bazel/bazel",
"@bazel/karma": "0.42.1",
"@bazel/protractor": "0.42.1",
"@bazel/rollup": "0.42.1",
"@bazel/terser": "0.42.1",
"@bazel/typescript": "0.42.1",
"@bazel/karma": "0.40.0",
"@bazel/protractor": "0.40.0",
"@bazel/rollup": "0.40.0",
"@bazel/terser": "0.40.0",
"@bazel/typescript": "0.40.0",
"@types/jasmine": "2.8.8",
"html-insert-assets": "^0.1.0",
"http-server": "0.11.1",
"karma": "4.4.1",
"karma-chrome-launcher": "3.1.0",
"karma-firefox-launcher": "1.2.0",
"karma-jasmine": "2.0.1",
"karma-requirejs": "1.1.0",
"karma-sourcemap-loader": "^0.3.7",
"protractor": "5.4.2",
"requirejs": "2.3.6",
"rollup": "1.25.2",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-resolve": "5.2.0",
Expand Down
49 changes: 8 additions & 41 deletions integration/bazel/src/BUILD.bazel
@@ -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")
Expand Down Expand Up @@ -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"],
Expand All @@ -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(
Expand Down

0 comments on commit ad98702

Please sign in to comment.