fix: register sources before the next compiler gets invoked

This commit is contained in:
TopchetoEU 2025-01-09 00:11:57 +02:00
parent 36f9839485
commit ec1edb981e
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
3 changed files with 3 additions and 7 deletions

View File

@ -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));
};
}

View File

@ -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));
};
}

View File

@ -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);