6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { JsonValue , workspaces } from '@angular-devkit/core' ;
9
+ import { JsonValue , tags , workspaces } from '@angular-devkit/core' ;
10
10
import { Rule } from '@angular-devkit/schematics' ;
11
11
import { allTargetOptions , allWorkspaceTargets , updateWorkspace } from '../../utility/workspace' ;
12
12
@@ -30,29 +30,39 @@ const ServerBuilderOptions: BuilderOptionsType = [
30
30
] ;
31
31
32
32
export default function ( ) : Rule {
33
- return updateWorkspace ( ( workspace ) => {
34
- for ( const [ , target ] of allWorkspaceTargets ( workspace ) ) {
35
- if ( ! target ?. builder . startsWith ( '@angular-devkit/build-angular' ) ) {
36
- continue ;
37
- }
33
+ return ( _tree , context ) =>
34
+ updateWorkspace ( ( workspace ) => {
35
+ for ( const [ targetName , target , projectName ] of allWorkspaceTargets ( workspace ) ) {
36
+ if (
37
+ ! target . builder . startsWith ( '@angular-devkit/' ) &&
38
+ ! target . builder . startsWith ( '@nguniversal/' )
39
+ ) {
40
+ context . logger . warn ( tags . stripIndent `
41
+ "${ targetName } " target in "${ projectName } " project is using a third-party builder.
42
+ You may need to adjust the options to retain the existing behavior.
43
+ For more information, see the breaking changes section within the release notes: https://github.com/angular/angular-cli/releases/tag/v12.0.0
44
+ ` ) ;
38
45
39
- // Only interested in Angular Devkit browser and server builders
40
- switch ( target . builder ) {
41
- case '@angular-devkit/build-angular:server' :
42
- updateOptions ( target , ServerBuilderOptions ) ;
43
- break ;
44
- case '@angular-devkit/build-angular:browser' :
45
- updateOptions ( target , BrowserBuilderOptions ) ;
46
- break ;
47
- }
46
+ continue ;
47
+ }
48
48
49
- for ( const [ , options ] of allTargetOptions ( target ) ) {
50
- delete options . experimentalRollupPass ;
51
- delete options . lazyModules ;
52
- delete options . forkTypeChecker ;
49
+ // Only interested in Angular Devkit browser and server builders
50
+ switch ( target . builder ) {
51
+ case '@angular-devkit/build-angular:server' :
52
+ updateOptions ( target , ServerBuilderOptions ) ;
53
+ break ;
54
+ case '@angular-devkit/build-angular:browser' :
55
+ updateOptions ( target , BrowserBuilderOptions ) ;
56
+ break ;
57
+ }
58
+
59
+ for ( const [ , options ] of allTargetOptions ( target ) ) {
60
+ delete options . experimentalRollupPass ;
61
+ delete options . lazyModules ;
62
+ delete options . forkTypeChecker ;
63
+ }
53
64
}
54
- }
55
- } ) ;
65
+ } ) ;
56
66
}
57
67
58
68
function updateOptions (
0 commit comments