{"id":19369,"library":"babel-timing","title":"Babel Timing","description":"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.","status":"active","version":"0.9.1","language":"javascript","source_language":"en","source_url":"https://github.com/toomuchdesign/babel-timing","tags":["javascript","babel","profiler","performance","measurement","time","typescript"],"install":[{"cmd":"npm install babel-timing","lang":"bash","label":"npm"},{"cmd":"yarn add babel-timing","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-timing","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v0.9.0; CJS require will throw.","wrong":"const babelTiming = require('babel-timing');","symbol":"babelTiming","correct":"import { babelTiming } from 'babel-timing';"},{"note":"Named export from a subpath; ESM-only.","wrong":"const BabelTimingPlugin = require('babel-timing/webpack/plugin');","symbol":"BabelTimingPlugin","correct":"import { BabelTimingPlugin } from 'babel-timing/webpack/plugin';"},{"note":"Named export, not default; check README for exact export name.","wrong":"import BabelTimingReporter from 'babel-timing/jest/reporter';","symbol":"BabelTimingReporter","correct":"import { BabelTimingReporter } from 'babel-timing/jest/reporter';"}],"quickstart":{"code":"import { babelTiming } from 'babel-timing';\n\nasync function main() {\n  const results = await babelTiming(['src/**/*.js'], {\n    babelConfig: './babel.config.js' || false,\n    followImports: true,\n    include: ['**'],\n    exclude: ['**/node_modules/**'],\n    resolveMainFields: ['browser', 'module', 'main'],\n    resolveExtensions: ['.js', '.jsx', '.ts', '.tsx']\n  });\n  console.log(JSON.stringify(results, null, 2));\n}\nmain().catch(console.error);","lang":"typescript","description":"Measure Babel timing on a glob of files, following imports, with custom Babel config and resolve options."},"warnings":[{"fix":"Use import syntax or upgrade to a CJS-compatible version (<0.9.0).","message":"Version 0.9.0 migrated to ESM-only. CJS require() will fail.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Delete ./node_modules/.cache/babel-loader/ before running Webpack.","message":"When using Webpack integration, babel-loader cache must be deleted for profiling to be accurate.","severity":"gotcha","affected_versions":"all"},{"fix":"Use --no-babel-config flag instead of --babel-config false.","message":"CLI option --babelConfig with value false disables Babel config file loading. In future versions, use --no-babel-config instead.","severity":"deprecated","affected_versions":">=0.9.0"},{"fix":"Run Jest with --no-cache flag.","message":"Jest transformer requires --no-cache flag to avoid stale results.","severity":"gotcha","affected_versions":"all"},{"fix":"Update imports to use subpath exports syntax.","message":"Subpath exports (e.g., 'babel-timing/webpack/plugin') were introduced in v0.9.0. Older versions expect different import paths.","severity":"breaking","affected_versions":">=0.9.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import { babelTiming } from 'babel-timing'; or downgrade to <0.9.0.","cause":"Using require() on an ESM-only package version >=0.9.0.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module from babel-timing"},{"fix":"Ensure you use babel-timing >=0.9.0 and import using the exact subpath.","cause":"Importing from a subpath that is not exported in older versions or using wrong path.","error":"Cannot find module 'babel-timing/webpack/plugin'"},{"fix":"Use import { BabelTimingPlugin } from 'babel-timing/webpack/plugin'; instead of default import.","cause":"Using default import when the export is named.","error":"BabelTimingPlugin is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}