Skip to content

bzlparty/rules_html

Repository files navigation

Bazel Rules for HTML

Test

Installation

See install instructions on the release page.

Usage

Generate an HTML file:

load("@bzlparty_rules_html//:defs.bzl", "html_file")

html_file(
    name = "index",
    out = "index.html",
    body = [
        "<p>Hello, World!</p>",
        "<script src=\"$(location :hello_world.js)\"></script>":
    ],
    title = "Hello, World!",
    data = [
        ":hello_world.js",
    ],
)

Bundle an HTML file:

load("@bzlparty_rules_html//:defs.bzl", "html_bundle")

html_bundle(
    name = "bundle",
    out = "bundle.html",
    endtry_point = ":index.html",
)

Development

Install git hooks:

pre-commit install

License

GNU GPL 3.0