Skip to content

Commit

Permalink
Adds style to external example.
Browse files Browse the repository at this point in the history
Refs #48.

This mostly works but requires `postcss-import` to be installed in the user's workspace. It doesn't bother me that much right now though, since this is all still on `@build_bazel_rules_nodejs` infra. Once we update to Parcel with `@aspect_rules_js`, this shouldn't be an issue.
  • Loading branch information
dgp1130 committed Feb 11, 2023
1 parent ebae5c9 commit ffb736a
Show file tree
Hide file tree
Showing 7 changed files with 269 additions and 39 deletions.
8 changes: 7 additions & 1 deletion examples/external/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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", "prerender_pages", "web_resources_devserver")
load("@rules_prerender//:index.bzl", "css_library", "prerender_pages", "web_resources_devserver")

npm_link_all_packages(name = "node_modules")

Expand All @@ -17,6 +17,7 @@ prerender_pages(
name = "site",
src = "site.ts",
scripts = [":script"],
styles = [":styles"],
source_map = True, # TODO(#48): This doesn't seem to work?
tsconfig = "//:tsconfig.json",
lib_deps = ["//:node_modules/rules_prerender"],
Expand All @@ -29,6 +30,11 @@ ts_project(
source_map = True,
)

css_library(
name = "styles",
srcs = ["style.css"],
)

web_resources_devserver(
name = "devserver",
resources = ":site",
Expand Down
Loading

0 comments on commit ffb736a

Please sign in to comment.