S

rules_terser

Created Apr 20, 2022 by aspect-build

Categories

Language:

Starlark

Stars:

6

Forks:

3

README

Bazel rules for terser

terser is a JavaScript minifier.

These rules teach Bazel how to interact with the terser CLI.

Need help? This ruleset has support provided by https://aspect.build/services.

Installation

From the release you wish to use:

copy the WORKSPACE snippet into your WORKSPACE file.

Usage

See the API documentation and the example usage in the examples/ directory. Note that the examples rely on code in the /WORKSPACE file in the root of this repo.

From a BUILD file

This is the most common usage. See examples/minify

From a macro

You could write a Bazel macro which uses terser, by calling it from a genrule or run_binary. This is illustrated in examples/macro.

From a custom rule

The most advanced usage is to write your own custom rule.

This is a good choice if you need to integrate with other Bazel rules via Providers.

Last updated: Jan 17, 2026

More MCP servers built with Starlark

rules_ts

Bazel rules for the `tsc` compiler from http://typescriptlang.org

By aspect-build 131
rules_swc

Bazel rules for the swc toolchain https://swc.rs/

By aspect-build 48
rules_esbuild

Bazel rules for https://esbuild.github.io/ JS bundler

By aspect-build 33