diff --git a/examples/shared_chunks/BUILD.bazel b/examples/shared_chunks/BUILD.bazel index b6663163..85b143b1 100644 --- a/examples/shared_chunks/BUILD.bazel +++ b/examples/shared_chunks/BUILD.bazel @@ -1,5 +1,5 @@ load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") -load("//:index.bzl", "prerender_pages", "web_resources_devserver") +load("//:index.bzl", prerender_pages = "prerender_pages2", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_node_test") load("//tools/typescript:defs.bzl", "ts_project") @@ -10,35 +10,25 @@ copy_to_bin( prerender_pages( name = "site", - src = "site.tsx", - scripts = [":hello", ":goodbye"], - tsconfig = "//:tsconfig", - source_map = True, + entry_point = "./site.js", + prerender = ":prerender", + scripts = ":scripts", +) + +ts_project( + name = "prerender", + srcs = ["site.tsx"], # Need `"type": "module"` to load `*.js` files output by `*.tsx` compilation. data = [":package"], - lib_deps = [ + deps = [ "//:node_modules/@rules_prerender/preact", "//:node_modules/preact", ], ) ts_project( - name = "hello", - srcs = ["hello.mts"], - tsconfig = "//:tsconfig_client", - deps = [":shared"], -) - -ts_project( - name = "goodbye", - srcs = ["goodbye.mts"], - tsconfig = "//:tsconfig_client", - deps = [":shared"], -) - -ts_project( - name = "shared", - srcs = ["shared.mts"], + name = "scripts", + srcs = ["hello.mts", "goodbye.mts", "shared.mts"], tsconfig = "//:tsconfig_client", )