A Karma plugin preprocessor that loads existing JavaScript source map files (both inline and external) into the Karma test runner. Version 0.4.0 is current stable. Unlike karma-sourcemap-preprocessor, this plugin does not generate source maps but locates them from previous build steps (e.g., TypeScript, Babel, webpack). It supports remapping source paths via prefix replacement or custom callback, and modifying sourceRoot. Inline source maps using base64 are also supported. Release cadence is low, primarily maintenance updates. Key differentiator: solves source map loading when compilation happens outside Karma.
npm install karma-sourcemap-loaderVerified import paths — ran on the pinned version, not inferred.
Configures Karma to load existing source maps for all JS files, remapping paths with a prefix.
Use 'sourcemap' as the preprocessor name in preprocessors config.
Use 'sourceMapLoader' in config.set().
Upgrade Node.js to version 10 or later.
Use 'remapPrefixes' object instead of 'remapSource' function if possible.
Ensure preprocessors config uses 'sourcemap' exactly, e.g., preprocessors: { '**/*.js': ['sourcemap'] }.Rename file to .cjs or use export default or dynamic import() for ES modules.