Skip to content

Commit

Permalink
Migrates data 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 07da6c6 commit e4d84c0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions examples/data/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_web_test_suite")
load("//tools/typescript:defs.bzl", "ts_project")

Expand All @@ -10,21 +10,25 @@ copy_to_bin(

prerender_pages(
name = "site",
src = "site.tsx",
tsconfig = "//:tsconfig",
source_map = True,
entry_point = "./site.js",
prerender = ":prerender",
bundle_js = False, # Optimization: No client-side JavaScript on this site.
)

ts_project(
name = "prerender",
srcs = ["site.tsx"],
# Data dependency on any files needed for prerendering.
data = glob(["content/*.txt"]) + [
# Need `"type": "module"` to load `*.js` files output by `*.tsx`
# compilation.
":package",
],
bundle_js = False, # Optimization: No client-side JavaScript on this site.
lib_deps = [
deps = [
"//:node_modules/@rules_prerender/preact",
"//:node_modules/@types/node",
"//:node_modules/preact",
],
]
)

web_resources_devserver(
Expand Down

0 comments on commit e4d84c0

Please sign in to comment.