File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed
packages/react-scripts/scripts Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -122,9 +122,17 @@ checkBrowsers(paths.appPath, isInteractive)
122122 ) ;
123123 } ,
124124 err => {
125- console . log ( chalk . red ( 'Failed to compile.\n' ) ) ;
126- printBuildError ( err ) ;
127- process . exit ( 1 ) ;
125+ const tscCompileOnError = process . env . TSC_COMPILE_ON_ERROR === 'true' ;
126+ if ( tscCompileOnError ) {
127+ console . log ( chalk . yellow (
128+ 'Compiled with the following type errors (you may want to check these before deploying your app):\n'
129+ ) ) ;
130+ printBuildError ( err ) ;
131+ } else {
132+ console . log ( chalk . red ( 'Failed to compile.\n' ) ) ;
133+ printBuildError ( err ) ;
134+ process . exit ( 1 ) ;
135+ }
128136 }
129137 )
130138 . catch ( err => {
Original file line number Diff line number Diff line change @@ -154,9 +154,19 @@ checkBrowsers(paths.appPath, isInteractive)
154154 ) ;
155155 } ,
156156 err => {
157- console . log ( chalk . red ( 'Failed to compile.\n' ) ) ;
158- printBuildError ( err ) ;
159- process . exit ( 1 ) ;
157+ const tscCompileOnError = process . env . TSC_COMPILE_ON_ERROR === 'true' ;
158+ if ( tscCompileOnError ) {
159+ console . log (
160+ chalk . yellow (
161+ 'Compiled with the following type errors (you may want to check these before deploying your app):\n'
162+ )
163+ ) ;
164+ printBuildError ( err ) ;
165+ } else {
166+ console . log ( chalk . red ( 'Failed to compile.\n' ) ) ;
167+ printBuildError ( err ) ;
168+ process . exit ( 1 ) ;
169+ }
160170 }
161171 )
162172 . catch ( err => {
You can’t perform that action at this time.
0 commit comments