Skip to content
Bazel rules that support breaking a typescript codebase into small, independently-compilable libraries. "Batteries not included".
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
rules
scenarios
.gitignore
LICENSE
README.md

README.md

Please read this post.

Provides a single key rule, tsc, which allows a typescript project to be split into small libraries, and for those libraries to be independently compiled.

In contrast to rules_typescript, it depends on a few core bazel rules and has no other dependencies. You plug in your own nodejs executable, tsc implementation, and tsconfig.json.

Comes with bonus rules for creating and minifying js bundles, from the results of tsc compilation. All sourcemaps contain original typescript source code.

Installation

TODO

Example usage

load("@rules_multi_tsc//:def.bzl", "tsc")

tsc(
    name="tsc",
    ts_path="polygon",
    srcs=glob(["*.ts"]),
    deps=["//02_dependent/basics:tsc"],

    node_executable="@node//:bin/node",
    tsc_script="@node_modules_archive//:node_modules/typescript/lib/tsc.js",
    tsconfig_json="//:tsconfig.json",
)

This example compiles .ts files in the current directory, and makes associated typescript definitions available at the polygon path, e.g.:

import {Hexagon} from "polygon/hexagon"

Please see the scenarios directory for more examples.

You can’t perform that action at this time.