From eeed98b2d1d9f0e3b7cf437443fdbaa313b58337 Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Wed, 27 Sep 2017 11:44:56 -0500 Subject: [PATCH] fix(ngc): don't replace deeplink config if an existing one exists --- src/ngc.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ngc.ts b/src/ngc.ts index ffd61e70..2e3df569 100644 --- a/src/ngc.ts +++ b/src/ngc.ts @@ -5,6 +5,7 @@ import { convertDeepLinkConfigEntriesToString, getUpdatedAppNgModuleContentWithDeepLinkConfig, filterTypescriptFilesForDeepLinks, + hasExistingDeepLinkConfig, purgeDeepLinkDecorator } from './deep-linking/util'; import { Logger } from './logger/logger'; @@ -50,8 +51,10 @@ export function transformTsForDeepLinking(context: BuildContext) { tsFile.content = purgeDeepLinkDecorator(tsFile.content); }); const tsFile = context.fileCache.get(getStringPropertyValue(Constants.ENV_APP_NG_MODULE_PATH)); - const deepLinkString = convertDeepLinkConfigEntriesToString(getParsedDeepLinkConfig()); - tsFile.content = getUpdatedAppNgModuleContentWithDeepLinkConfig(tsFile.path, tsFile.content, deepLinkString); + if (!hasExistingDeepLinkConfig(tsFile.path, tsFile.content)) { + const deepLinkString = convertDeepLinkConfigEntriesToString(getParsedDeepLinkConfig()); + tsFile.content = getUpdatedAppNgModuleContentWithDeepLinkConfig(tsFile.path, tsFile.content, deepLinkString); + } } return Promise.resolve(); }