Skip to content

Commit

Permalink
use normalized path when checking for mangled new contents,
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Jan 23, 2023
1 parent 990ffad commit c56209b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build/lib/compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
let ts2tsMangler = new Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data));
const newContentsByFileName = ts2tsMangler.computeNewFileContents();
mangleStream = es.through(function write(data: File & { sourceMap?: RawSourceMap }) {
const newContents = newContentsByFileName.get(data.path);
type TypeScriptExt = typeof ts & { normalizePath(path: string): string };
const tsNormalPath = (<TypeScriptExt>ts).normalizePath(data.path);
const newContents = newContentsByFileName.get(tsNormalPath);
if (newContents !== undefined) {
data.contents = Buffer.from(newContents.out);
data.sourceMap = newContents.sourceMap && JSON.parse(newContents.sourceMap);
Expand Down

0 comments on commit c56209b

Please sign in to comment.