Skip to content
PluginStats

babel-plugin-transform-define weekly downloads statistics

By FormidableLabs (3 listings) · npm · Babel plugins

Babel plugin that replaces member expressions and typeof statements with strings

View on npm Fresh · Dec 6, 2026

babel-plugin-transform-define has 297,010 recorded weekly downloads on npm, a decrease of 12.8% over the past 30 days, ranking #470 of 3,247 tracked listings.

Weekly downloads
297,010
Official API · Dec 5, 2026
7-day growth
+12.1%
+32.1K weekly downloads
30-day growth
-12.8%
-43.6K weekly downloads
90-day growth
+57.0%
+107.8K weekly downloads
Rank
#470
▲ 1 in 7 days

About babel-plugin-transform-define

<a href="https://formidable.com/open-source/" target="_blank"> <img alt="Babel Plugin Transform Define — Formidable, We build the modern web" src="https://raw.githubusercontent.com/FormidableLabs/babel-plugin-transform-define/master/babel-plugin-transform-define-Hero.png" /> </a> <p align="center"> <a title='Build Status' href="https://raw.githubusercontent.com/FormidableLabs/babel-plugin-transform-define/master/LICENSE"> <img src='https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square' /> </a> <a href="https://badge.fury.io/js/babel-plugin-transform-define"> <img src="https://badge.fury.io/js/babel-plugin-transform-define.svg" alt="npm version" height="18"> </a> <a href='https://github.com/FormidableLabs/babel-plugin-transform-define/actions'> <img src='https://github.com/FormidableLabs/babel-plugin-transform-define/workflows/CI/badge.svg' /> </a> <a href='https://github.com/FormidableLabs/babel-plugin-transform-define#maintenance-status'> <img alt="Maintenance Status" src='https://img.shields.io/badge/maintenance-stable-yellow.svg?color=yellow&style=flat' /> </a> </p> <h4 align="center"> Compile time code replacement for babel similar to Webpack's <a href='https://webpack.js.org/plugins/define-plugin/'>DefinePlugin</a> </h4>

Quick Start

$ npm install --save-dev babel-plugin-transform-define

.babelrc

{
  "plugins": [
    ["transform-define", {
      "process.env.NODE_ENV": "production",
      "typeof window": "object"
    }]
  ]
}

.babelrc.js

// E.g., any dynamic logic with JS, environment variables, etc.
const overrides = require("./another-path.js");

module.exports = {
  plugins: [
    ["transform-define", {
      "process.env.NODE_ENV": "production",
      "typeof window": "object",
      ...overrides
    }]
  ]
};

Reference Documentation

babel-plugin-transform-define can transform certain types of code as a babel transformation.

Identifiers

.babelrc

{
  "plugins": [
    ["transform-define", {
      "VERSION": "1.0.0",
    }]
  ]
}

Source Code

VERSION;

window.__MY_COMPANY__ = {
  version: VERSION
};

Output Code

"1.0.0";

window.__MY_COMPANY__ = {
  version: "1.0.0"
};

Member Expressions

.babelrc

{
  "plugins": [
    ["transform-define", {
      "process.env.NODE_ENV": "production"
    }]
  ]
}

Source Code

if (process.env.NODE_ENV === "production") {
  console.log(true);
}

Output Code

if (true) {
  console.log(true);
}

Unary Expressions

.babelrc

{
  "plugins": [
    ["transform-define", {
      "typeof window": "object"
    }]
  ]
}

Source Code

typeof window;
typeof window === "object";

Output Code

'object';
true;

License

MIT License

Maintenance Status

Stable: Formidable is not planning to develop any new features for this project. We are still responding to bug reports and security concerns. We are still welcoming PRs for this project, but PRs that include new features should be small and easy to integrate and should not include breaking changes.

Description from the npm listing.

  • babel-plugin
  • babel-transform
  • babel
  • define
  • DefinePlugin
  • webpack

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

babel-plugin-transform-define weekly downloads on npm, last 90 days: 297,010 weekly downloads as of Dec 5, 2026, +57.0% over 90 days.babel-plugin-transform-defineWeekly downloads on npm · Last 90 days297,010downloads / week+57.0% over 90 days050K100K150K200K250K300K350KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
babel-plugin-transform-define weekly downloads on npm, last 90 days: 297,010 weekly downloads as of Dec 5, 2026, +57.0% over 90 days.

7/30/90-day growth

babel-plugin-transform-define weekly downloads growth on npm: +12.1% over 7 days, -12.8% over 30 days, +57.0% over 90 days.babel-plugin-transform-defineWeekly downloads growth on npm297,010downloads / week now7-day growth+32,082 weekly downloads+12.1%30-day growth-43,576 weekly downloads-12.8%90-day growth+107,788 weekly downloads+57.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-define weekly downloads growth on npm: +12.1% over 7 days, -12.8% over 30 days, +57.0% over 90 days.

Ranking history

babel-plugin-transform-define npm ranking history: currently #470 (by weekly downloads).babel-plugin-transform-definenpm ranking · by weekly downloads · Last 90 days#470current rank#150#200#250#300#350#400#450#500Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-define npm ranking history: currently #470 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 24, #10 (overall #470)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins263 listings · 14 pages · page 11, #16 (overall #216)
Babel plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for babel-plugin-transform-define
Date (UTC)Weekly downloadsChange vs. previous
297,010+382
296,628+17.9K
278,722+14.6K
264,137+4.2K
259,932-1.7K
261,616+4.2K
257,465-7.5K
264,928-680
265,608-4K
269,633-15.3K
284,973-4.6K
289,532-1.6K
291,115+3K
288,093—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/babel-plugin-transform-define. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.