Registry / observability / babel-timing

babel-timing

JSON →
library0.9.1jsnpmunverified

Measure Babel compilation time per file and per plugin. Version 0.9.1 (beta). Use it to profile Babel when applications or tests take ages to build. Supports CLI, Node API, Webpack plugin, and Jest transformer/reporter. Ships TypeScript types. Distinct from generic profilers by focusing specifically on Babel's transform pipeline, breaking down time by file and by plugin. Active development; minor releases may include breaking changes.

npm install babel-timing
INSTALL
IMPORT
SIG · BABEL-TIMING
B
babel-timing
observabilityjavascriptv0.9.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

babelTiming
import { babelTiming } from 'babel-timing';
const babelTiming = require('babel-timing');
ESM-only since v0.9.0; CJS require will throw.
BabelTimingPlugin
import { BabelTimingPlugin } from 'babel-timing/webpack/plugin';
const BabelTimingPlugin = require('babel-timing/webpack/plugin');
Named export from a subpath; ESM-only.
BabelTimingReporter
import { BabelTimingReporter } from 'babel-timing/jest/reporter';
import BabelTimingReporter from 'babel-timing/jest/reporter';
Named export, not default; check README for exact export name.

Measure Babel timing on a glob of files, following imports, with custom Babel config and resolve options.

import { babelTiming } from 'babel-timing'; async function main() { const results = await babelTiming(['src/**/*.js'], { babelConfig: './babel.config.js' || false, followImports: true, include: ['**'], exclude: ['**/node_modules/**'], resolveMainFields: ['browser', 'module', 'main'], resolveExtensions: ['.js', '.jsx', '.ts', '.tsx'] }); console.log(JSON.stringify(results, null, 2)); } main().catch(console.error);
babel-timing --version
Debug
Known issues
breakingVersion 0.9.0 migrated to ESM-only. CJS require() will fail.
fix
Use import syntax or upgrade to a CJS-compatible version (<0.9.0).
affects: >=0.9.0
gotchaWhen using Webpack integration, babel-loader cache must be deleted for profiling to be accurate.
fix
Delete ./node_modules/.cache/babel-loader/ before running Webpack.
affects: all
deprecatedCLI option --babelConfig with value false disables Babel config file loading. In future versions, use --no-babel-config instead.
fix
Use --no-babel-config flag instead of --babel-config false.
affects: >=0.9.0
gotchaJest transformer requires --no-cache flag to avoid stale results.
fix
Run Jest with --no-cache flag.
affects: all
breakingSubpath exports (e.g., 'babel-timing/webpack/plugin') were introduced in v0.9.0. Older versions expect different import paths.
fix
Update imports to use subpath exports syntax.
affects: >=0.9.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module from babel-timing
Using require() on an ESM-only package version >=0.9.0.
fix
Use import { babelTiming } from 'babel-timing'; or downgrade to <0.9.0.
Cannot find module 'babel-timing/webpack/plugin'
Importing from a subpath that is not exported in older versions or using wrong path.
fix
Ensure you use babel-timing >=0.9.0 and import using the exact subpath.
BabelTimingPlugin is not a constructor
Using default import when the export is named.
fix
Use import { BabelTimingPlugin } from 'babel-timing/webpack/plugin'; instead of default import.
Upgrade
Version history
0.9.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
27
Amazon
1
OpenAI (training)
1
Resources
babel-timing — npm install babel-timing · libregistry