Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit eeed98b

Browse files
committed
fix(ngc): don't replace deeplink config if an existing one exists
1 parent c51ac93 commit eeed98b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ngc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
convertDeepLinkConfigEntriesToString,
66
getUpdatedAppNgModuleContentWithDeepLinkConfig,
77
filterTypescriptFilesForDeepLinks,
8+
hasExistingDeepLinkConfig,
89
purgeDeepLinkDecorator
910
} from './deep-linking/util';
1011
import { Logger } from './logger/logger';
@@ -50,8 +51,10 @@ export function transformTsForDeepLinking(context: BuildContext) {
5051
tsFile.content = purgeDeepLinkDecorator(tsFile.content);
5152
});
5253
const tsFile = context.fileCache.get(getStringPropertyValue(Constants.ENV_APP_NG_MODULE_PATH));
53-
const deepLinkString = convertDeepLinkConfigEntriesToString(getParsedDeepLinkConfig());
54-
tsFile.content = getUpdatedAppNgModuleContentWithDeepLinkConfig(tsFile.path, tsFile.content, deepLinkString);
54+
if (!hasExistingDeepLinkConfig(tsFile.path, tsFile.content)) {
55+
const deepLinkString = convertDeepLinkConfigEntriesToString(getParsedDeepLinkConfig());
56+
tsFile.content = getUpdatedAppNgModuleContentWithDeepLinkConfig(tsFile.path, tsFile.content, deepLinkString);
57+
}
5558
}
5659
return Promise.resolve();
5760
}

0 commit comments

Comments
 (0)