Skip to content

Commit

Permalink
Migrates shared_chunks example to prerender_component2.
Browse files Browse the repository at this point in the history
Refs #40.
  • Loading branch information
dgp1130 committed Jul 22, 2023
1 parent 5589abb commit 73d66a4
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions examples/shared_chunks/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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")

Expand All @@ -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",
)

Expand Down

0 comments on commit 73d66a4

Please sign in to comment.