mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-14 09:13:01 +08:00
fix(cache): Support non-inline source maps
This commit is contained in:
parent
ccab6dea6c
commit
e38d7b10ea
1 changed files with 9 additions and 1 deletions
|
@ -112,7 +112,15 @@ require('source-map-support').install({
|
|||
}
|
||||
|
||||
const sourceMappingURL = lastMatch[1]
|
||||
const rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1)
|
||||
|
||||
// check whether this is a file path, or an inline sourcemap and load it
|
||||
let rawData = null;
|
||||
if (sourceMappingURL.includes(',')) {
|
||||
rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1);
|
||||
} else {
|
||||
rawData = fs.readFileSync(path.resolve(path.dirname(filePath), sourceMappingURL));
|
||||
}
|
||||
|
||||
let sourceMap = null;
|
||||
try {
|
||||
sourceMap = JSON.parse(new Buffer(rawData, 'base64'))
|
||||
|
|
Loading…
Reference in a new issue