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
smart-source-map-loader
A Smart Source Map Loader for Webpack
scalajs-friendly-source-map-loader
Drop in replacement for source-map-loader that understands file:// and https:// in the scala.js output source map files.
@skoging/react-app-rewire-source-map-loader
Add [source-map-loader](https://github.com/webpack-contrib/source-map-loader) to a [react-app-rewired](https://github.com/timarney/react-app-rewired) config.
react-app-rewire-source-map-loader
Add [source-map-loader](https://github.com/webpack-contrib/source-map-loader) to a [react-app-rewired](https://github.com/timarney/react-app-rewired) config.
extract sourceMappingURL comments from modules and offer it to webpack
npm install source-map-loader
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
364 Stars
177 Commits
84 Forks
16 Watching
2 Branches
42 Contributors
Updated on 08 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.4%
1,405,460
Compared to previous day
Last week
1.6%
7,358,171
Compared to previous week
Last month
8.1%
31,009,565
Compared to previous month
Last year
9.9%
350,342,793
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
1 existing vulnerabilities detected
Details
Reason
Found 22/29 approved changesets -- score normalized to 7
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
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 2024-11-18
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