canirequire

canirequireCommonJS › babel-plugin-transform-runtime

Is babel-plugin-transform-runtime ESM-only? Can you require() it?

Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

Last verified Sep 9, 2026 against babel-plugin-transform-runtime@6.23.0. JSON

CommonJS CommonJS — require() works on every Node.js version

babel-plugin-transform-runtime ships CommonJS only. require("babel-plugin-transform-runtime") works everywhere. import "babel-plugin-transform-runtime" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Latest
6.23.0 (Feb 13, 2017)
Module format
CommonJS
Last CommonJS version
6.23.0
TypeScript types
None
Node engines
not declared
Weekly downloads
348K
License
MIT

Does babel-plugin-transform-runtime@6.23.0 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("babel-plugin-transform-runtime") from a CommonJS file and import "babel-plugin-transform-runtime" from an ES module.

Runtimerequire("babel-plugin-transform-runtime")import "babel-plugin-transform-runtime"
Node.js 18✓ works✓ works
Node.js 20✓ works✓ works
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4✓ works✓ works

How to import babel-plugin-transform-runtime

ES modules (import)

import babelPluginTransformRuntime from "babel-plugin-transform-runtime";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

const babelPluginTransformRuntime = require("babel-plugin-transform-runtime");

Module format by version

Derived from the type, main and exports fields of every stable release on npm (21 versions; the newest 21 shown).

VersionsFormatFirst published
6.0.2 – 6.23.0CommonJSOct 29, 2015

Frequently asked

Is babel-plugin-transform-runtime ESM-only?

babel-plugin-transform-runtime@6.23.0 is a CommonJS package. babel-plugin-transform-runtime ships CommonJS only. require("babel-plugin-transform-runtime") works everywhere. import "babel-plugin-transform-runtime" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Can I import babel-plugin-transform-runtime with ES module syntax?

Yes. import babelPluginTransformRuntime from "babel-plugin-transform-runtime" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

Does babel-plugin-transform-runtime work in Bun?

Yes. import "babel-plugin-transform-runtime" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does babel-plugin-transform-runtime ship TypeScript types?

No. babel-plugin-transform-runtime ships no type declarations and there is no @types package for it.

Links

Other commonjs packages

Similar popularity