Prefer object sourcemaps over file-inlined sourcemaps.
This commit is contained in:
parent
5895277b32
commit
3c90baaf6c
@ -27,15 +27,23 @@ export default function normalizeFile(
|
|||||||
|
|
||||||
let inputMap = null;
|
let inputMap = null;
|
||||||
if (options.inputSourceMap !== false) {
|
if (options.inputSourceMap !== false) {
|
||||||
try {
|
// If an explicit object is passed in, it overrides the processing of
|
||||||
inputMap = convertSourceMap.fromSource(code);
|
// source maps that may be in the file itself.
|
||||||
|
if (typeof options.inputSourceMap === "object") {
|
||||||
|
inputMap = convertSourceMap.fromObject(options.inputSourceMap);
|
||||||
|
}
|
||||||
|
|
||||||
if (inputMap) {
|
if (!inputMap) {
|
||||||
|
try {
|
||||||
|
inputMap = convertSourceMap.fromSource(code);
|
||||||
|
|
||||||
|
if (inputMap) {
|
||||||
|
code = convertSourceMap.removeComments(code);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
debug("discarding unknown inline input sourcemap", err);
|
||||||
code = convertSourceMap.removeComments(code);
|
code = convertSourceMap.removeComments(code);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
|
||||||
debug("discarding unknown inline input sourcemap", err);
|
|
||||||
code = convertSourceMap.removeComments(code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inputMap) {
|
if (!inputMap) {
|
||||||
@ -50,10 +58,6 @@ export default function normalizeFile(
|
|||||||
code = convertSourceMap.removeMapFileComments(code);
|
code = convertSourceMap.removeMapFileComments(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inputMap && typeof options.inputSourceMap === "object") {
|
|
||||||
inputMap = convertSourceMap.fromObject(options.inputSourceMap);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast) {
|
if (ast) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user