Skip to content

Commit adf6934

Browse files
committed
fix(examples): kotlin example server working
1 parent 242379f commit adf6934

3 files changed

Lines changed: 5 additions & 15 deletions

File tree

examples/kotlin/BUILD.bazel

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
55
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_js_import", "kt_js_library")
66
load("@npm//http-server:index.bzl", "http_server")
7-
load("@npm_bazel_inject_html//:index.bzl", "inject_html")
87
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
98
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
109
load("@npm_bazel_terser//:index.bzl", "terser_minified")
@@ -23,7 +22,7 @@ kt_js_library(
2322
deps = [":kotlinx-html-js"],
2423
)
2524

26-
# Copy boostrap.js to the bin folder as _bootstrap.js
25+
# Copy bootstrap.js to the bin folder as _bootstrap.js
2726
# so that relative import to `./hello.js` is valid
2827
genrule(
2928
name = "bootstrap",
@@ -49,23 +48,16 @@ rollup_bundle(
4948
)
5049

5150
terser_minified(
52-
# This will output bundle.min.js
51+
# This will output bundle.min directory since rollup produces a directory
5352
name = "bundle.min",
5453
src = ":bundle",
5554
)
5655

57-
inject_html(
58-
name = "inject_script_tag",
59-
src = "index.html",
60-
# Having a .js file here causes the injector to add a script tag
61-
assets = [":bundle.min.js"],
62-
)
63-
6456
pkg_web(
6557
name = "package",
6658
srcs = [
67-
"inject_script_tag",
68-
":bundle.min",
59+
"bundle.min",
60+
"index.html",
6961
],
7062
)
7163

examples/kotlin/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<head>
33
<title>rules_kotlin webapp example</title>
44
<link rel="icon" href="/favicon.png">
5-
<!-- CSS will be linked here -->
65
</head>
7-
<!-- JS scripts will be included here -->
6+
<script src="bundle.min/bundle.js"></script>
87
</html>

examples/kotlin/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "kotlin_example",
33
"private": true,
44
"devDependencies": {
5-
"@bazel/inject-html": "^0.40.0",
65
"@bazel/jasmine": "^0.40.0",
76
"@bazel/rollup": "^0.40.0",
87
"@bazel/terser": "^0.40.0",

0 commit comments

Comments
 (0)