33const path = require ( "path" ) ;
44const fs = require ( "fs" ) ;
55
6- const browserDynamicDependency = "@angular/platform-browser-dynamic" ;
76const binPath = __dirname ;
87const pluginPath = path . dirname ( binPath ) ;
98const pluginPackageJsonPath = path . join ( pluginPath , "package.json" ) ;
@@ -28,17 +27,25 @@ function updateDeps(deps, devDeps, newDeps) {
2827 deps [ dependencyName ] = version ;
2928 }
3029
31- console . log ( `Updated dependency ${ dependencyName } to version: ${ version } .` ) ;
30+ logUpdatedDependency ( dependencyName , version ) ;
3231 } ) ;
3332
3433 const ngDep = Object . keys ( newDeps ) . find ( dep => dep . startsWith ( "@angular" ) ) ;
3534 const version = newDeps [ ngDep ] ;
36- if ( deps [ "@angular/animations" ] ) {
37- deps [ "@angular/animations" ] = version ;
35+ const animationsDependency = "@angular/animations" ;
36+ if ( deps [ animationsDependency ] ) {
37+ deps [ animationsDependency ] = version ;
38+ logUpdatedDependency ( animationsDependency , version ) ;
3839 }
3940
40- if ( deps [ "@angular/compiler-cli" ] ) {
41- deps [ "@angular/compiler-cli" ] = version ;
41+ const compilerCliDependency = "@angular/compiler-cli" ;
42+ if ( devDeps [ compilerCliDependency ] ) {
43+ devDeps [ compilerCliDependency ] = version ;
44+ logUpdatedDependency ( compilerCliDependency , version ) ;
45+ }
46+
47+ function logUpdatedDependency ( dependencyName , version ) {
48+ console . log ( `Updated dependency ${ dependencyName } to version: ${ version } .` ) ;
4249 }
4350}
4451
0 commit comments