fix: register sources before the next compiler gets invoked
This commit is contained in:
parent
36f9839485
commit
ec1edb981e
@ -11,17 +11,14 @@ export default function babel(next: Compiler): Compiler {
|
||||
presets: [availablePresets.env],
|
||||
});
|
||||
|
||||
print(res.map!.mappings);
|
||||
|
||||
const map = SourceMap.parse({
|
||||
file: "babel-internal://" + filename,
|
||||
mappings: res.map!.mappings,
|
||||
sources: [filename],
|
||||
});
|
||||
|
||||
const compiled = next("babel-internal://" + filename, res.code!, SourceMap.chain(map, prevMap));
|
||||
registerSource(filename, code);
|
||||
return compiled;
|
||||
return next("babel-internal://" + filename, res.code!, SourceMap.chain(map, prevMap));
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,8 @@ export default function coffee(next: Compiler): Compiler {
|
||||
sources: [filename],
|
||||
});
|
||||
|
||||
const compiled = next("coffee-internal://" + filename, result, SourceMap.chain(map, prevMap));
|
||||
registerSource(filename, code);
|
||||
return compiled;
|
||||
return next("coffee-internal://" + filename, result, SourceMap.chain(map, prevMap));
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,8 @@ export default function typescript(next: Compiler): Compiler {
|
||||
const result = outputs["/src.js"];
|
||||
const declaration = outputs["/src.d.ts"];
|
||||
|
||||
const compiled = next("ts-internal://" + filename, result, SourceMap.chain(map, prevMap));
|
||||
registerSource(filename, code);
|
||||
const compiled = next("ts-internal://" + filename, result, SourceMap.chain(map, prevMap));
|
||||
|
||||
return function (this: any) {
|
||||
const res = compiled.apply(this, arguments);
|
||||
|
Loading…
Reference in New Issue
Block a user