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

Commit

Permalink
fix(optimization): don't purge ctorParams for angular core or angular…
Browse files Browse the repository at this point in the history
… platform browser

don't purge ctorParams for angular core or angular platform browser
  • Loading branch information
danbucholtz committed Apr 12, 2017
1 parent 30ecdd8 commit 9562181
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/optimization/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export function purgeStaticFieldDecorators(filePath: string, originalFileContent
export function purgeStaticCtorFields(filePath: string, originalFileContent: string, magicString: MagicString) {
// TODO - we could extend this to other libs and stuff too such as material 2, but that doesn't seem
// particularly maintainable
if (isIonicOrAngular(filePath) && !isIonicEntryComponent(filePath)) {
if (isIonicOrAngular(filePath) && !isIonicEntryComponent(filePath)
&& !filePath.includes('@angular/platform-browser')
&& !filePath.includes('@angular/core')) {
Logger.debug(`[decorators] purgeStaticCtorFields: processing ${filePath} ...`);
const typescriptFile = getTypescriptSourceFile(filePath, originalFileContent);
const expressionStatements = findNodes(typescriptFile, typescriptFile, SyntaxKind.ExpressionStatement, false) as ExpressionStatement[];
Expand Down
4 changes: 4 additions & 0 deletions src/util/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,7 @@ export function isIonicOrAngular(filePath: string) {
return (filePath.startsWith(getStringPropertyValue(Constants.ENV_VAR_AT_ANGULAR_DIR))
|| filePath.startsWith(getStringPropertyValue(Constants.ENV_VAR_IONIC_ANGULAR_DIR)));
}

export function isIonic(filePath: string) {
return filePath.startsWith(getStringPropertyValue(Constants.ENV_VAR_IONIC_ANGULAR_DIR));
}

0 comments on commit 9562181

Please sign in to comment.