fix(compiler): make tsx file aot compatible

fixes #20555
This commit is contained in:
Trotyl
2017-11-29 15:27:16 +08:00
committed by Alex Rickabaugh
parent d91ff17adc
commit 05ff6c09ca
7 changed files with 80 additions and 8 deletions

View File

@ -337,7 +337,7 @@ class AngularCompilerProgram implements Program {
metadataJsonCount++;
const metadata = this.metadataCache.getMetadata(sf);
const metadataText = JSON.stringify([metadata]);
const outFileName = srcToOutPath(sf.fileName.replace(/\.ts$/, '.metadata.json'));
const outFileName = srcToOutPath(sf.fileName.replace(/\.tsx?$/, '.metadata.json'));
this.writeFile(outFileName, metadataText, false, undefined, undefined, [sf]);
}
});