diff --git a/BUILD.bazel b/BUILD.bazel
index d222cc31a8..a5d2904247 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -91,7 +91,6 @@ npm_package(
"//third_party/github.com/bazelbuild/bazel-skylib:package_contents",
"//third_party/github.com/buffer-from:package_contents",
"//third_party/github.com/gjtorikian/isBinaryFile:package_contents",
- "//third_party/github.com/inikulin/parse5:package_contents",
"//third_party/github.com/juanjoDiaz/removeNPMAbsolutePaths:package_contents",
"//third_party/github.com/source-map:package_contents",
"//third_party/github.com/source-map-support:package_contents",
diff --git a/e2e/BUILD.bazel b/e2e/BUILD.bazel
index 9dc8278a70..272b4ebff4 100644
--- a/e2e/BUILD.bazel
+++ b/e2e/BUILD.bazel
@@ -83,6 +83,7 @@ e2e_integration_test(
name = "e2e_ts_devserver",
npm_packages = {
"//packages/hide-bazel-files:npm_package": "@bazel/hide-bazel-files",
+ "//packages/inject-html:npm_package": "@bazel/inject-html",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/typescript:npm_package": "@bazel/typescript",
},
diff --git a/e2e/ts_devserver/package.json b/e2e/ts_devserver/package.json
index bd66da7690..6a06eedc60 100644
--- a/e2e/ts_devserver/package.json
+++ b/e2e/ts_devserver/package.json
@@ -1,6 +1,7 @@
{
"dependencies": {
"@bazel/hide-bazel-files": "^0.40.0",
+ "@bazel/inject-html": "^0.40.0",
"@bazel/protractor": "^0.40.0",
"@bazel/typescript": "^0.40.0",
"@types/jasmine": "2.8.2",
diff --git a/e2e/ts_devserver/subpackage/BUILD.bazel b/e2e/ts_devserver/subpackage/BUILD.bazel
index fb5798db54..9095a6bc10 100644
--- a/e2e/ts_devserver/subpackage/BUILD.bazel
+++ b/e2e/ts_devserver/subpackage/BUILD.bazel
@@ -12,13 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+load("@npm_bazel_inject_html//:index.bzl", "inject_html")
load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")
+inject_html(
+ name = "inject",
+ src = "index.html",
+ assets = ["//:red-body-style.css"],
+)
+
ts_devserver(
name = "devserver",
- index_html = "index.html",
- static_files = ["//:red-body-style.css"],
+ static_files = [
+ "inject",
+ "//:red-body-style.css",
+ ],
)
ts_library(
diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel
index 112887bb71..ad6d2fdc87 100644
--- a/examples/BUILD.bazel
+++ b/examples/BUILD.bazel
@@ -18,6 +18,7 @@ example_integration_test(
name = "examples_angular",
timeout = "long",
npm_packages = {
+ "//packages/inject-html:npm_package": "@bazel/inject-html",
"//packages/karma:npm_package": "@bazel/karma",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
@@ -51,6 +52,7 @@ example_integration_test(
name = "examples_angular_view_engine",
timeout = "long",
npm_packages = {
+ "//packages/inject-html:npm_package": "@bazel/inject-html",
"//packages/karma:npm_package": "@bazel/karma",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
@@ -90,6 +92,7 @@ example_integration_test(
name = "examples_app",
npm_packages = {
"//packages/hide-bazel-files:npm_package": "@bazel/hide-bazel-files",
+ "//packages/inject-html:npm_package": "@bazel/inject-html",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
@@ -115,6 +118,7 @@ example_integration_test(
example_integration_test(
name = "examples_kotlin",
npm_packages = {
+ "//packages/inject-html:npm_package": "@bazel/inject-html",
"//packages/jasmine:npm_package": "@bazel/jasmine",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
diff --git a/examples/angular/package.json b/examples/angular/package.json
index f2f695da8f..ecf251abb6 100644
--- a/examples/angular/package.json
+++ b/examples/angular/package.json
@@ -36,6 +36,7 @@
"@bazel/benchmark-runner": "^0.1.0",
"@bazel/buildifier": "^0.29.0",
"@bazel/ibazel": "^0.10.3",
+ "@bazel/inject-html": "^0.40.0",
"@bazel/karma": "^0.40.0",
"@bazel/protractor": "^0.40.0",
"@bazel/rollup": "^0.40.0",
diff --git a/examples/angular/src/BUILD.bazel b/examples/angular/src/BUILD.bazel
index 64fe9e9b9f..0a24cecca4 100644
--- a/examples/angular/src/BUILD.bazel
+++ b/examples/angular/src/BUILD.bazel
@@ -5,6 +5,7 @@ load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("@npm//@babel/cli:index.bzl", "babel")
load("@npm//history-server:index.bzl", "history_server")
load("@npm_angular_bazel//:index.bzl", "ng_module")
+load("@npm_bazel_inject_html//:index.bzl", "inject_html")
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
load("@npm_bazel_terser//:index.bzl", "terser_minified")
load("@npm_bazel_typescript//:index.bzl", "ts_config", "ts_devserver", "ts_library")
@@ -85,23 +86,22 @@ _ASSETS = [
"@npm//:node_modules/zone.js/dist/zone.min.js",
]
+inject_html(
+ name = "inject_scripts_for_dev",
+ src = "//src:example/index.html",
+ assets = _ASSETS + ["_/ts_scripts.js"],
+)
+
# This devserver is written in Go and is super-fast.
# It doesn't run any bundler or code splitter. Instead, it concatenates
# named UMD and named AMD JavaScript code on-the-fly in-memory.
# This scales really well for massive codebases.
ts_devserver(
name = "devserver",
- # Serve these files but don't inject tags for them into the index file
- # This might be because we only want to lazy-load these scripts on-demand,
- # or because they aren't compatible with Require.js so we must use a runtime
- # loader to load them.
- data = [
- "//src/assets",
- ],
- # Start from the development version of the main
+ # Serve src/example/index.html at /index.html
+ additional_root_paths = ["src/example"],
+ # Run the program from the development version of the main
entry_module = "examples_angular/src/main.dev",
- #
-
-
-
-
-
+