File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
packages/react-scripts/scripts Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -120,14 +120,17 @@ prompt(
120120 console . log ( cyan ( 'Updating the scripts' ) ) ;
121121 delete appPackage . scripts [ 'eject' ] ;
122122 Object . keys ( appPackage . scripts ) . forEach ( function ( key ) {
123- appPackage . scripts [ key ] = appPackage . scripts [ key ]
124- . replace ( / r e a c t - s c r i p t s ( \w + ) / g, 'node scripts/$1.js' ) ;
125- console . log (
126- ' Replacing ' +
127- cyan ( '"react-scripts ' + key + '"' ) +
128- ' with ' +
129- cyan ( '"node scripts/' + key + '.js"' )
130- ) ;
123+ Object . keys ( ownPackage . bin ) . forEach ( function ( binKey ) {
124+ var regex = new RegExp ( binKey + ' (\\w+)' , 'g' ) ;
125+ appPackage . scripts [ key ] = appPackage . scripts [ key ]
126+ . replace ( regex , 'node scripts/$1.js' ) ;
127+ console . log (
128+ ' Replacing ' +
129+ cyan ( '"' + binKey + ' ' + key + '"' ) +
130+ ' with ' +
131+ cyan ( '"node scripts/' + key + '.js"' )
132+ ) ;
133+ } ) ;
131134 } ) ;
132135
133136 console . log ( ) ;
You can’t perform that action at this time.
0 commit comments