Skip to content

Bazel rules that support breaking a typescript codebase into small, independently-compilable libraries. "Batteries not included".

License

Notifications You must be signed in to change notification settings

sconover/rules_multi_tsc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Bazel rules that support breaking a typescript codebase into small, independently-compilable libraries. "Batteries not included".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published