Registry / devops / adjust-sourcemap-loader

adjust-sourcemap-loader

JSON →
library5.0.0jsnpmunverified

Webpack loader that adjusts source maps for debugging or inter-loader transformation. Currently at v5.0.0, released in 2025? Release cadence is irregular with major bumps alongside webpack majors. Key differentiator: it can be used both as a loader and as a module filename template to control output source map format (absolute, outputRelative, projectRelative, webpackProtocol, sourceRelative). Alternatives (like Webpack's built-in devtool) offer less granular control over intermediate source maps.

npm install adjust-sourcemap-loader
INSTALL
IMPORT
SIG · ADJUST-SOURCEMAP-L
A
adjust-sourcemap-loader
devopsjavascriptv5.0.0
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.

default (loader)
require('adjust-sourcemap-loader')
import adjustSourcemap from 'adjust-sourcemap-loader'
Used in webpack config as a loader, typically via require() in CommonJS. ESM imports not typical for loader usage.
moduleFilenameTemplate
const { moduleFilenameTemplate } = require('adjust-sourcemap-loader');
import { moduleFilenameTemplate } from 'adjust-sourcemap-loader';
Exported as a named function. Available via CommonJS require, but ESM may also work depending on your setup.
codecs
const { codecs } = require('adjust-sourcemap-loader');
Array of built-in codec objects. Rarely needed custom, but accessible if you want to inspect or extend.

Shows how to use adjust-sourcemap-loader both as a loader (with format option) and as a module filename template (for final output sources).

// webpack.config.js const path = require('path'); module.exports = { mode: 'development', entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', devtoolModuleFilenameTemplate: require('adjust-sourcemap-loader').moduleFilenameTemplate({ format: 'projectRelative' }) }, module: { rules: [ { test: /\.js$/, use: [ { loader: 'adjust-sourcemap?format=absolute' }, { loader: 'babel-loader', options: { sourceMaps: true } } ] } ] } };
Debug
Known issues
breakingVersion 5.0.0 requires Node >=12 and supports Webpack 5+ only.
fix
Upgrade Node to >=12 and ensure Webpack is version 5 or higher.
affects: >=5.0.0
breakingVersion 4.0.0 removed lodash dependency. Options must be explicitly provided; they cannot be undefined.
fix
Adjust your webpack config to provide explicit options objects where previously undefined was allowed.
affects: >=4.0.0
breakingVersion 3.0.0 removed overzealous decode check, which may cause silent failures for malformed source maps.
fix
Use the 'fail' option to ensure errors are thrown if a source-map source cannot be decoded.
affects: >=3.0.0
gotchaWhen using the loader, preceding loaders must have source maps enabled (sourceMap: true).
fix
Add ?sourceMap or sourceMaps: true to the preceding loader, e.g., babel?sourceMap.
affects: >=0
gotchaThe 'sourceRelative' format works for loader usage only, not for module filename template.
fix
Use a different format (e.g., 'projectRelative') for the module filename template.
affects: >=0
deprecatedThe 'codecs' option can be used to override built-in codecs, but doing so may break decoding unless you also include built-in codecs.
fix
If you specify custom codecs, also include the built-in codecs from require('adjust-sourcemap-loader').codecs.
affects: >=0
Errors
Common errors & fixes
Error: adjust-sourcemap-loader requires source maps to be enabled on preceding loaders
Preceding loader does not have source maps enabled.
fix
Add sourceMaps: true option to the loader that generates source maps (e.g., babel-loader).
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.
The adjust-sourcemap-loader is not applied as a loader in the webpack config.
fix
Ensure adjust-sourcemap-loader is included in your module.rules as a loader (e.g., use: ['adjust-sourcemap?format=absolute', 'babel-loader']).
Error: Cannot find module 'adjust-sourcemap-loader'
Package not installed.
fix
Run 'npm install adjust-sourcemap-loader --save-dev'.
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
54 hits · last 30 days
node
44
Perplexity
1
OpenAI (training)
1
Resources
adjust-sourcemap-loader — npm install adjust-sourcemap-loader · libregistry