$ show babel/babel-loader
babel-loader is a webpack loader that integrates Babel transpilation into the webpack build pipeline. It transpiles JavaScript files using Babel, supporting caching, custom configuration, metadata passing, and source map handling. The architecture is a single loader module that resolves Babel configuration per file, optionally caches results to the filesystem with compression and external dependency tracking, and returns transformed code and maps to webpack. It also exposes a `.custom()` builder for advanced customization of Babel's config and results. The codebase is well-structured, with clean separation of concerns (error formatting, caching, serialization, transform wrapper) and comprehensive tests against both webpack and Rspack.
The LLM identified 1 files worth highlighting for reuse:
Custom, fast, deterministic JSON serializer for Babel options. Sorts object keys, handles special values (NaN, Infinity, undefined), and respects toJSON methods. Used to generate cache keys for the filesystem cache. Self-contained with no internal dependencies, it can be extracted and reused in any project needing stable, order-independent object serialization.