Skip to content

Commit be635c7

Browse files
committed
3.2.0 build/wpbuild changes
1 parent b882601 commit be635c7

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

packages/react-scripts/scripts/build.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff 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 => {

packages/react-scripts/scripts/wpbuild.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff 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 => {

0 commit comments

Comments
 (0)