diff --git a/examples/external/BUILD.bazel b/examples/external/BUILD.bazel index cc8e6e55..eeea594d 100644 --- a/examples/external/BUILD.bazel +++ b/examples/external/BUILD.bazel @@ -3,7 +3,13 @@ load("@aspect_rules_js//npm:defs.bzl", "npm_link_package") load("@aspect_rules_ts//ts:defs.bzl", "ts_project") load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@npm_user//:defs.bzl", "npm_link_all_packages") -load("@rules_prerender//:index.bzl", "css_library", "prerender_pages", "web_resources_devserver") +load( + "@rules_prerender//:index.bzl", + "css_library", + "prerender_pages", + "web_resources", + "web_resources_devserver", +) npm_link_all_packages(name = "node_modules") @@ -18,6 +24,7 @@ prerender_pages( src = "site.ts", scripts = [":script"], styles = [":styles"], + resources = [":resources"], source_map = True, # TODO(#48): This doesn't seem to work? tsconfig = "//:tsconfig.json", lib_deps = ["//:node_modules/rules_prerender"], @@ -35,6 +42,13 @@ css_library( srcs = ["style.css"], ) +web_resources( + name = "resources", + entries = { + "/logo": "logo.png", + }, +) + web_resources_devserver( name = "devserver", resources = ":site", diff --git a/examples/external/logo.png b/examples/external/logo.png new file mode 100644 index 00000000..7f2ecaaa Binary files /dev/null and b/examples/external/logo.png differ diff --git a/examples/external/site.ts b/examples/external/site.ts index 97004825..16f7c13a 100644 --- a/examples/external/site.ts +++ b/examples/external/site.ts @@ -10,6 +10,8 @@ export default function*(): Generator {

Hello, World!

+ + ${includeScript('script.js')} ${inlineStyle('external/style.css')}