@@ -45,8 +45,6 @@ module.exports = function(
45
45
eject : 'react-scripts-ts eject' ,
46
46
} ;
47
47
48
- console . log ( appPackage ) ;
49
-
50
48
fs . writeFileSync (
51
49
path . join ( appPath , 'package.json' ) ,
52
50
JSON . stringify ( appPackage , null , 2 )
@@ -104,6 +102,23 @@ module.exports = function(
104
102
args = [ 'install' , '--save' , verbose && '--verbose' ] . filter ( e => e ) ;
105
103
}
106
104
105
+ // Install dev dependencies
106
+ const types = [
107
+ '@types/node' ,
108
+ '@types/react' ,
109
+ '@types/react-dom' ,
110
+ '@types/jest' ,
111
+ ] ;
112
+
113
+ console . log ( `Installing ${ types . join ( ', ' ) } as dev dependencies ${ command } ...` ) ;
114
+ console . log ( ) ;
115
+
116
+ const devProc = spawn . sync ( command , args . concat ( '-D' ) . concat ( types ) , { stdio : 'inherit' } ) ;
117
+ if ( devProc . status !== 0 ) {
118
+ console . error ( `\`${ command } ${ args . concat ( types ) . join ( ' ' ) } \` failed` ) ;
119
+ return ;
120
+ }
121
+
107
122
// Install additional template dependencies, if present
108
123
const templateDependenciesPath = path . join (
109
124
appPath ,
@@ -119,22 +134,6 @@ module.exports = function(
119
134
fs . unlinkSync ( templateDependenciesPath ) ;
120
135
}
121
136
122
- const types = [
123
- '@types/node' ,
124
- '@types/react' ,
125
- '@types/react-dom' ,
126
- '@types/jest' ,
127
- ] ;
128
-
129
- console . log ( `Installing ${ types . join ( ', ' ) } ${ command } ...` ) ;
130
- console . log ( ) ;
131
-
132
- const proc = spawn . sync ( command , args . concat ( types ) , { stdio : 'inherit' } ) ;
133
- if ( proc . status !== 0 ) {
134
- console . error ( `\`${ command } ${ args . concat ( types ) . join ( ' ' ) } \` failed` ) ;
135
- return ;
136
- }
137
-
138
137
// Install react and react-dom for backward compatibility with old CRA cli
139
138
// which doesn't install react and react-dom along with react-scripts
140
139
// or template is presetend (via --internal-testing-template)
0 commit comments