Skip to content

v0.14.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 21 Mar 19:50
· 33 commits to main since this release
1192dba

⚠️ BREAKING CHANGES ⚠️

The terser_minified rule is renamed to just terser. This has been planned for a while to do before 1.0 and included in this release to go along with other breaking changes. terser_repositories repository rule is removed and a new node_modules attribute is now required for terser. This changes are BREAKING for all users.

The //path/to:node_modules tree target must be passed to the terser rule via the node_modules attribute. For example,

terser(
    name = "minify",
    node_modules = "//:node_modules",
    ...
)

You'll need terser linked in the node_modules tree provided.

This change has the added benefits of not requiring users to keep the terser version used in their package.json in sync with their WORKSPACE and not requiring any changes to rules_terser to support new releases of terser.

This change is in the spirit of the changes in rules_webpack v0.11.0 and rules_jasmine v0.4.0 and will also be rolled out to rules_jest, rules_rollup in the near future so the patterns on the downstream rules_js rulesets we maintain are aligned both for maintainers and for users.

WORKSPACE snippet

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_terser",
    sha256 = "1a8e6bce01b2316a114e1c415e3d1db560fc472a9ff110168ac859f468d0b0d2",
    strip_prefix = "rules_terser-0.14.0",
    url = "https://github.com/aspect-build/rules_terser/releases/download/v0.14.0/rules_terser-v0.14.0.tar.gz",
)

######################
# rules_terser setup #
######################

# Fetch the Bazel module dependencies

load("@aspect_rules_terser//terser:dependencies.bzl", "rules_terser_dependencies")

rules_terser_dependencies()

# Fetch and register a nodejs interpreter, if you haven't already

load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

nodejs_register_toolchains(
    name = "node",
    node_version = DEFAULT_NODE_VERSION,
)

load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock")

npm_translate_lock(
    name = "npm",
    npmrc = "//:.npmrc",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)

load("@npm//:repositories.bzl", "npm_repositories")

npm_repositories()

What's Changed

New Contributors

Full Changelog: v0.13.0...v0.14.0