Skip to content

Commit

Permalink
feat(@schematics/angular): add migration to remove deprecated server …
Browse files Browse the repository at this point in the history
…options
  • Loading branch information
alan-agius4 authored and dgp1130 committed May 5, 2020
1 parent 08062e9 commit 25fafcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"update-angular-config": {
"version": "10.0.0-beta.3",
"factory": "./update-10/update-angular-config",
"description": "Remove deprecated 'evalSourceMap', `profile`, 'skipAppShell' and 'vendorSourceMap' from 'angular.json'."
"description": "Remove various deprecated builders options from 'angular.json'."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { workspaces } from '@angular-devkit/core';
import { Rule } from '@angular-devkit/schematics';
import { updateWorkspace } from '../../utility/workspace';
import { ProjectType } from '../../utility/workspace-models';
import { Builders, ProjectType } from '../../utility/workspace-models';

export default function (): Rule {
return updateWorkspace(workspace => {
Expand All @@ -25,13 +25,22 @@ export default function (): Rule {
continue;
}

let extraOptionsToRemove = {};
if (target.builder === Builders.Server) {
extraOptionsToRemove = {
vendorChunk: undefined,
commonChunk: undefined,
};
}

// Check options
if (target.options) {
target.options = {
...updateVendorSourceMap(target.options),
evalSourceMap: undefined,
skipAppShell: undefined,
profile: undefined,
...extraOptionsToRemove,
};
}

Expand All @@ -46,6 +55,7 @@ export default function (): Rule {
evalSourceMap: undefined,
skipAppShell: undefined,
profile: undefined,
...extraOptionsToRemove,
};
}
}
Expand Down

0 comments on commit 25fafcc

Please sign in to comment.