# kentcdodds/babel-plugin-macros

🎣 Allows you to build simple compile-time libraries

Repository: https://github.com/kentcdodds/babel-plugin-macros
Canonical: https://ross.abutalabs.com/products/babel-plugin-macros
Homepage: https://npm.im/babel-plugin-macros
Language: JavaScript
License: MIT
License Family: permissive
Topics: babel, babel-plugin, babel-macros
Last push: 2023-05-30T11:04:41+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3345, "days_push": 1191, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2633, forks 138 (observed 2026-08-28T04:07:06.158832+00:00)

## What it is
babel-plugin-macros defines a standard interface for Babel macros, letting libraries perform compile-time code transformations without users needing to configure individual Babel plugins. It is widely used by libraries like css-in-js tools to shift runtime work to build time.

## Use cases
- run compile-time code transformations without configuring individual babel plugins
- optimize css-in-js libraries by generating class names at build time
- build a zero-config compile-time library for javascript
- reduce client bundle size by moving work from runtime to build time
- support macros in a create-react-app project without changing babel config

## When to choose
- you maintain a library that benefits from compile-time code transformation
- you want users to get build-time optimizations with zero babel configuration
- you are using a boilerplate like create-react-app that already includes babel-plugin-macros

## When to avoid
- you need language-level syntax transforms that require dedicated babel plugins
- your project does not use babel or a bundler with babel support
- you need runtime-only transformations

## Facets
- artifact type: library
- maturity: maintenance
- function: compiler, build-tool, plugin-system, developer-tools
- domain: developer-tools, web-development, frontend, compilers
- platform: -
- tags: babel-plugin, babel-macros, compile-time-code-transformation, zero-config, build-optimization, nodejs, javascript

## Member repositories
- kentcdodds/babel-plugin-macros (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:06.158832+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:19:35.145373+00:00, confidence not recorded.
  - readme: https://github.com/kentcdodds/babel-plugin-macros (fetched 2026-08-28T04:07:06.158832+00:00, sha 32beec67698f)
  - registry_npm: https://registry.npmjs.org/babel-plugin-macros (fetched 2026-08-29T10:02:36.238748+00:00, sha 521276d1e052)
- Data as of 2026-08-30T08:39:29.467469+00:00.
