File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44load ("@build_bazel_rules_nodejs//:index.bzl" , "pkg_web" )
55load ("@io_bazel_rules_kotlin//kotlin:kotlin.bzl" , "kt_js_import" , "kt_js_library" )
66load ("@npm//http-server:index.bzl" , "http_server" )
7- load ("@npm_bazel_inject_html//:index.bzl" , "inject_html" )
87load ("@npm_bazel_jasmine//:index.bzl" , "jasmine_node_test" )
98load ("@npm_bazel_rollup//:index.bzl" , "rollup_bundle" )
109load ("@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
2827genrule (
2928 name = "bootstrap" ,
@@ -49,23 +48,16 @@ rollup_bundle(
4948)
5049
5150terser_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-
6456pkg_web (
6557 name = "package" ,
6658 srcs = [
67- "inject_script_tag " ,
68- ":bundle.min " ,
59+ "bundle.min " ,
60+ "index.html " ,
6961 ],
7062)
7163
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments