source-map-loader
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [2.0.1](https://github.com/webpack-contrib/source-map-loader/compare/v2.0.0...v2.0.1) (2021-02-10) | ||
### Bug Fixes | ||
* switch from `source-map` to `source-map-js` package (perf increase) | ||
* fix watch with invalid `sourceURL` | ||
## [2.0.0](https://github.com/webpack-contrib/source-map-loader/compare/v1.1.3...v2.0.0) (2020-12-24) | ||
@@ -7,0 +14,0 @@ |
@@ -14,3 +14,3 @@ "use strict"; | ||
var _sourceMap = _interopRequireDefault(require("source-map")); | ||
var _sourceMapJs = _interopRequireDefault(require("source-map-js")); | ||
@@ -38,6 +38,6 @@ var _iconvLite = require("iconv-lite"); | ||
async function flattenSourceMap(map) { | ||
const consumer = await new _sourceMap.default.SourceMapConsumer(map); | ||
const generatedMap = map.file ? new _sourceMap.default.SourceMapGenerator({ | ||
const consumer = await new _sourceMapJs.default.SourceMapConsumer(map); | ||
const generatedMap = map.file ? new _sourceMapJs.default.SourceMapGenerator({ | ||
file: map.file | ||
}) : new _sourceMap.default.SourceMapGenerator(); | ||
}) : new _sourceMapJs.default.SourceMapGenerator(); | ||
consumer.sources.forEach(sourceFile => { | ||
@@ -134,3 +134,6 @@ const sourceContent = consumer.sourceContentFor(sourceFile, true); | ||
return buffer.toString(); | ||
return { | ||
path: sourceURL, | ||
data: buffer.toString() | ||
}; | ||
} | ||
@@ -191,3 +194,5 @@ | ||
const sourceContent = await fetchFromFilesystem(loaderContext, sourceURL); | ||
const { | ||
data: sourceContent | ||
} = await fetchFromFilesystem(loaderContext, sourceURL); | ||
return { | ||
@@ -209,3 +214,3 @@ sourceURL, | ||
if (_path.default.isAbsolute(url)) { | ||
const sourceURL = _path.default.normalize(url); | ||
let sourceURL = _path.default.normalize(url); | ||
@@ -221,3 +226,5 @@ let sourceContent; | ||
sourceContent = await fetchPathsFromFilesystem(loaderContext, possibleRequests); | ||
const result = await fetchPathsFromFilesystem(loaderContext, possibleRequests); | ||
sourceURL = result.path; | ||
sourceContent = result.data; | ||
} | ||
@@ -236,3 +243,6 @@ | ||
if (!skipReading) { | ||
sourceContent = await fetchFromFilesystem(loaderContext, sourceURL); | ||
const { | ||
data | ||
} = await fetchFromFilesystem(loaderContext, sourceURL); | ||
sourceContent = data; | ||
} | ||
@@ -239,0 +249,0 @@ |
{ | ||
"name": "source-map-loader", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "extracts inlined source map and offers it to webpack", | ||
@@ -46,11 +46,10 @@ "license": "MIT", | ||
"iconv-lite": "^0.6.2", | ||
"source-map": "^0.6.1" | ||
"source-map-js": "^0.6.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.12.10", | ||
"@babel/core": "^7.12.10", | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/cli": "^7.12.13", | ||
"@babel/core": "^7.12.13", | ||
"@babel/preset-env": "^7.12.13", | ||
"@commitlint/cli": "^11.0.0", | ||
"@commitlint/config-conventional": "^11.0.0", | ||
"@webpack-contrib/defaults": "^6.3.0", | ||
"@webpack-contrib/eslint-config-webpack": "^3.0.0", | ||
@@ -61,13 +60,13 @@ "babel-jest": "^26.6.3", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.16.0", | ||
"eslint-config-prettier": "^7.1.0", | ||
"eslint": "^7.19.0", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"husky": "^4.3.6", | ||
"husky": "^4.3.8", | ||
"jest": "^26.6.3", | ||
"lint-staged": "^10.5.3", | ||
"lint-staged": "^10.5.4", | ||
"memfs": "^3.2.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.2.1", | ||
"standard-version": "^9.0.0", | ||
"webpack": "^5.11.0" | ||
"standard-version": "^9.1.0", | ||
"webpack": "^5.21.2" | ||
}, | ||
@@ -74,0 +73,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37755
21
709
+ Addedsource-map-js@^0.6.2
+ Addedsource-map-js@0.6.2(transitive)
- Removedsource-map@^0.6.1