Gathering detailed insights and metrics for source-map-loader
Gathering detailed insights and metrics for source-map-loader
Gathering detailed insights and metrics for source-map-loader
Gathering detailed insights and metrics for source-map-loader
adjust-sourcemap-loader
Webpack loader that adjusts source maps
karma-sourcemap-loader
Karma plugin that locates and loads existing javascript source map files.
smart-source-map-loader
A Smart Source Map Loader for Webpack
source-map-loader-cli
extracts inlined source map and offers it to webpack
extract sourceMappingURL comments from modules and offer it to webpack
npm install source-map-loader
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
373 Stars
183 Commits
85 Forks
15 Watchers
2 Branches
42 Contributors
Updated on Jun 20, 2025
Latest Version
5.0.0
Package Id
source-map-loader@5.0.0
Unpacked Size
35.05 kB
Size
10.48 kB
File Count
9
NPM Version
10.2.3
Node Version
18.19.0
Published on
Jan 15, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
Extracts source maps from existing source files (from their sourceMappingURL
).
To begin, you'll need to install source-map-loader
:
1npm i -D source-map-loader
or
1yarn add -D source-map-loader
or
1pnpm add -D source-map-loader
Then add the plugin to your webpack
config. For example:
file.js
1import css from "file.css";
webpack.config.js
1module.exports = { 2 module: { 3 rules: [ 4 { 5 test: /\.js$/, 6 enforce: "pre", 7 use: ["source-map-loader"], 8 }, 9 ], 10 }, 11};
The source-map-loader
extracts existing source maps from all JavaScript entries.
This includes both inline source maps as well as those linked via URL.
All source map data is passed to webpack for processing as per a chosen source map style specified by the devtool
option in webpack.config.js.
This loader is especially useful when using 3rd-party libraries having their own source maps.
If not extracted and processed into the source map of the webpack bundle, browsers may misinterpret source map data. source-map-loader
allows webpack to maintain source map data continuity across libraries so ease of debugging is preserved.
The source-map-loader
will extract from any JavaScript file, including those in the node_modules
directory.
Be mindful in setting include and exclude rule conditions to maximize bundling performance.
And run webpack
via your preferred method.
Name | Type | Default | Description |
---|---|---|---|
filterSourceMappingUrl | {Function} | undefined | Allows to control SourceMappingURL behaviour |
Type: Function
Default: undefined
Allows you to specify the behavior of the loader for SourceMappingURL
comment.
The function must return one of the values:
true
or 'consume'
- consume the source map and remove SourceMappingURL
comment (default behavior)false
or 'remove'
- do not consume the source map and remove SourceMappingURL
commentskip
- do not consume the source map and do not remove SourceMappingURL
commentExample configuration:
webpack.config.js
1module.exports = { 2 module: { 3 rules: [ 4 { 5 test: /\.js$/, 6 enforce: "pre", 7 use: [ 8 { 9 loader: "source-map-loader", 10 options: { 11 filterSourceMappingUrl: (url, resourcePath) => { 12 if (/broker-source-map-url\.js$/i.test(url)) { 13 return false; 14 } 15 16 if (/keep-source-mapping-url\.js$/i.test(resourcePath)) { 17 return "skip"; 18 } 19 20 return true; 21 }, 22 }, 23 }, 24 ], 25 }, 26 ], 27 }, 28};
To ignore warnings, you can use the following configuration:
webpack.config.js
1module.exports = { 2 module: { 3 rules: [ 4 { 5 test: /\.js$/, 6 enforce: "pre", 7 use: ["source-map-loader"], 8 }, 9 ], 10 }, 11 ignoreWarnings: [/Failed to parse source map/], 12};
More information about the ignoreWarnings
option can be found here
Please take a moment to read our contributing guidelines if you haven't yet done so.
No vulnerabilities found.
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 21/30 approved changesets -- score normalized to 7
Reason
5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More