Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

source-map-loader

Package Overview
Dependencies
Maintainers
8
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

source-map-loader - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [1.1.2](https://github.com/webpack-contrib/source-map-loader/compare/v1.1.1...v1.1.2) (2020-10-27)
### Bug Fixes
* do not watch unnecessary `sources` ([23768df](https://github.com/webpack-contrib/source-map-loader/commit/23768df65e1ea4773114ec004a29d1271e9ab02d))
### [1.1.1](https://github.com/webpack-contrib/source-map-loader/compare/v1.1.0...v1.1.1) (2020-10-09)

@@ -7,0 +14,0 @@

21

dist/index.js

@@ -85,3 +85,3 @@ "use strict";

} catch (parseError) {
this.emitWarning(new Error(`Failed to parse source map from '${sourceURL}': ${parseError}`));
this.emitWarning(new Error(`Failed to parse source map from '${sourceMappingURL}': ${parseError}`));
callback(null, input, inputMap);

@@ -103,4 +103,6 @@ return;

let sourceContent;
const originalSourceContent = map.sourcesContent && map.sourcesContent[i] ? map.sourcesContent[i] : null;
const skipReading = originalSourceContent !== null; // We do not skipReading here, because we need absolute paths in sources.
const originalSourceContent = map.sourcesContent && typeof map.sourcesContent[i] !== 'undefined' ? map.sourcesContent[i] : // eslint-disable-next-line no-undefined
undefined;
const skipReading = typeof originalSourceContent !== 'undefined';
let errored = false; // We do not skipReading here, because we need absolute paths in sources.
// This is necessary so that for sourceMaps with the same file structure in sources, name collisions do not occur.

@@ -115,16 +117,15 @@ // https://github.com/webpack-contrib/source-map-loader/issues/51

} catch (error) {
errored = true;
this.emitWarning(error);
sourceURL = source;
}
if (originalSourceContent) {
if (skipReading) {
sourceContent = originalSourceContent;
}
if (sourceURL) {
} else if (!errored && sourceURL) {
this.addDependency(sourceURL);
}
} // Return original value of `source` when error happens
return {
sourceURL,
sourceURL: errored ? source : sourceURL,
sourceContent

@@ -131,0 +132,0 @@ };

@@ -165,4 +165,11 @@ "use strict";

if (protocol === 'data:') {
if (skipReading) {
return {
sourceURL: ''
};
}
const sourceContent = fetchFromDataURL(loaderContext, url);
return {
sourceURL: '',
sourceContent

@@ -190,3 +197,3 @@ };

throw new Error(`Failed to parse source map: "${url}" URL is not supported`);
throw new Error(`Failed to parse source map: '${url}' URL is not supported`);
} // 2. It's a scheme-relative

@@ -196,3 +203,3 @@

if (/^\/\//.test(url)) {
throw new Error(`Failed to parse source map: "${url}" URL is not supported`);
throw new Error(`Failed to parse source map: '${url}' URL is not supported`);
} // 3. Absolute path

@@ -199,0 +206,0 @@

{
"name": "source-map-loader",
"version": "1.1.1",
"version": "1.1.2",
"description": "extracts inlined source map and offers it to webpack",

@@ -52,5 +52,5 @@ "license": "MIT",

"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@commitlint/cli": "^11.0.0",

@@ -60,12 +60,12 @@ "@commitlint/config-conventional": "^11.0.0",

"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^26.5.2",
"babel-jest": "^26.6.1",
"cross-env": "^7.0.2",
"del": "^6.0.0",
"del-cli": "^3.0.1",
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"eslint": "^7.12.0",
"eslint-config-prettier": "^6.14.0",
"eslint-plugin-import": "^2.22.1",
"husky": "^4.3.0",
"jest": "^26.5.2",
"lint-staged": "^10.4.0",
"jest": "^26.6.1",
"lint-staged": "^10.4.2",
"memfs": "^3.2.0",

@@ -75,3 +75,3 @@ "npm-run-all": "^4.1.5",

"standard-version": "^9.0.0",
"webpack": "^4.44.2"
"webpack": "^5.2.0"
},

@@ -78,0 +78,0 @@ "keywords": [

@@ -134,10 +134,6 @@ <div align="center">

},
stats: {
warningsFilter: [/Failed to parse source map/],
},
ignoreWarnings: [/Failed to parse source map/],
};
```
More information about the `warningsFilters` option you can find [here](https://webpack.js.org/configuration/stats/#statswarningsfilter);
## Contributing

@@ -144,0 +140,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc