Skip to content
PluginStats

babel-plugin-transform-es2015-modules-umd weekly downloads statistics

By babel (206 listings) · npm · Babel plugins

This plugin transforms ES2015 modules to UMD

View on npm Fresh · Dec 6, 2026

babel-plugin-transform-es2015-modules-umd has 1,244,516 recorded weekly downloads on npm, a decrease of 6.7% over the past 30 days, ranking #277 of 3,247 tracked listings.

Weekly downloads
1,244,516
Official API · Dec 5, 2026
7-day growth
-1.2%
-14.8K weekly downloads
30-day growth
-6.7%
-89.3K weekly downloads
90-day growth
-3.4%
-43.5K weekly downloads
Rank
#277
▼ 7 in 7 days

About babel-plugin-transform-es2015-modules-umd

babel-plugin-transform-es2015-modules-umd

This plugin transforms ES2015 modules to Universal Module Definition (UMD).

Example

In

export default 42;

Out

(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports);
    global.actual = mod.exports;
  }
})(this, function (exports) {
  "use strict";

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  exports.default = 42;
});

Installation

npm install --save-dev babel-plugin-transform-es2015-modules-umd

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-es2015-modules-umd"]
}

You can also override the names of particular libraries when this module is running in the browser. For example the es6-promise library exposes itself as global.Promise rather than global.es6Promise. This can be accommodated by:

{
  "plugins": [
    ["transform-es2015-modules-umd", {
      "globals": {
        "es6-promise": "Promise"
      }
    }]
  ]
}
Default semantics

There are a few things to note about the default semantics.

First, this transform uses the basename of each import to generate the global names in the UMD output. This means that if you're importing multiple modules with the same basename, like:

import fooBar1 from "foo-bar";
import fooBar2 from "./mylib/foo-bar";

it will transpile into two references to the same browser global:

factory(global.fooBar, global.fooBar);

If you set the plugin options to:

{
  "globals": {
    "foo-bar": "fooBAR",
    "./mylib/foo-bar": "mylib.fooBar"
  }
}

it will still transpile both to one browser global:

factory(global.fooBAR, global.fooBAR);

because again the transform is only using the basename of the import.

Second, the specified override will still be passed to the toIdentifier function in babel-types/src/converters. This means that if you specify an override as a member expression like:

{
  "globals": {
    "fizzbuzz": "fizz.buzz"
  }
}

this will not transpile to factory(global.fizz.buzz). Instead, it will transpile to factory(global.fizzBuzz) based on the logic in toIdentifier.

Third, you cannot override the exported global name.

More flexible semantics with exactGlobals: true

All of these behaviors can limit the flexibility of the globals map. To remove these limitations, you can set the exactGlobals option to true. Doing this instructs the plugin to:

  1. always use the full import string instead of the basename when generating the global names
  2. skip passing globals overrides to the toIdentifier function. Instead, they are used exactly as written, so you will get errors if you do not use valid identifiers or valid uncomputed (dot) member expressions.
  3. allow the exported global name to be overridden via the globals map. Any override must again be a valid identifier or valid member expression.

Thus, if you set exactGlobals to true and do not pass any overrides, the first example of:

import fooBar1 from "foo-bar";
import fooBar2 from "./mylib/foo-bar";

will transpile to:

factory(global.fooBar, global.mylibFooBar);

And if you set the plugin options to:

{
  "globals": {
    "foo-bar": "fooBAR",
    "./mylib/foo-bar": "mylib.fooBar"
  },
  "exactGlobals": true
}

then it'll transpile to:

factory(global.fooBAR, global.mylib.fooBar)

Finally, with the plugin options set to:

{
  "plugins": [
    "external-helpers",
    ["transform-es2015-modules-umd", {
      "globals": {
        "my/custom/module/name": "My.Custom.Module.Name"
      },
      "exactGlobals": true
    }]
  ],
  "moduleId": "my/custom/module/name"
}

it will transpile to:

factory(mod.exports);
global.My = global.My || {};
global.My.Custom = global.My.Custom || {};
global.My.Custom.Module = global.My.Custom.Module || {};
global.My.Custom.Module.Name = mod.exports;
Via CLI
babel --plugins transform-es2015-modules-umd script.js
Via Node API
require("babel-core").transform("code", {
  plugins: ["transform-es2015-modules-umd"]
});

Description from the npm listing.

  • babel-plugin

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-es2015-modules-umd weekly downloads on npm, last 90 days: 1,244,516 weekly downloads as of Dec 5, 2026, -3.4% over 90 days.babel-plugin-transform-es2015-modules-…Weekly downloads on npm · Last 90 days1,244,516downloads / week-3.4% over 90 days0500K1M1.5M2M2.5MSep 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-es2015-modules-umd weekly downloads on npm, last 90 days: 1,244,516 weekly downloads as of Dec 5, 2026, -3.4% over 90 days.

7/30/90-day growth

babel-plugin-transform-es2015-modules-umd weekly downloads growth on npm: -1.2% over 7 days, -6.7% over 30 days, -3.4% over 90 days.babel-plugin-transform-es2015-modules-…Weekly downloads growth on npm1,244,516downloads / week now7-day growth-14,815 weekly downloads-1.2%30-day growth-89,277 weekly downloads-6.7%90-day growth-43,454 weekly downloads-3.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-es2015-modules-umd weekly downloads growth on npm: -1.2% over 7 days, -6.7% over 30 days, -3.4% over 90 days.

Ranking history

babel-plugin-transform-es2015-modules-umd npm ranking history: currently #277 (by weekly downloads).babel-plugin-transform-es2015-modules-…npm ranking · by weekly downloads · Last 90 days#277current rank#240#245#250#255#260#265#270#275#280Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-es2015-modules-umd npm ranking history: currently #277 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 14, #17 (overall #277)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins263 listings · 14 pages · page 8, #6 (overall #146)
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 (170)
Recent weekly downloads observations for babel-plugin-transform-es2015-modules-umd
Date (UTC)Weekly downloadsChange vs. previous
1,244,516-6.2K
1,250,703+7.6K
1,243,150+25.9K
1,217,249-7.2K
1,224,442+6.7K
1,217,714-24.7K
1,242,417-16.9K
1,259,331-18.6K
1,277,917-19.2K
1,297,074-37.1K
1,334,218-3.8K
1,337,985+8.5K
1,329,444+41.4K
1,288,021—

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-es2015-modules-umd. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.