Skip to content

Commit 8854204

Browse files
committed
don't rename symbols that start with ɵɵ
1 parent 20b0df6 commit 8854204

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/package-tools/compile-entry-point.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ function addImportAs(packageName: string, outputPath: string, secondaryEntryPoin
7171
function addIdToGlob(outputPath: string, entryPointId: number): void {
7272
glob(join(outputPath, '**/*.+(js|d.ts|metadata.json)')).forEach(filePath => {
7373
let fileContent = readFileSync(filePath, 'utf-8');
74-
fileContent = fileContent.replace(/(ɵ[a-z]+)/g, `$1${entryPointId}`);
74+
// We check for double ɵ to avoid mangling symbols like `ɵɵdefineInjectable`.
75+
fileContent = fileContent.replace(/ɵ(ɵ)?[a-z]+/g,
76+
(match, isDoubleTheta) => {
77+
return isDoubleTheta ? match : match + entryPointId;
78+
});
7579
writeFileSync(filePath, fileContent, 'utf-8');
7680
});
7781
}
82+

0 commit comments

Comments
 (0)