Skip to content

Commit 38c2fb6

Browse files
committed
Set debug mode option default to 'none'
1 parent 6f381b1 commit 38c2fb6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

development/webpack/test/cli.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('./utils/cli.ts', () => {
2626
generatePolicy: false,
2727
snow: false,
2828
reactCompilerVerbose: false,
29-
reactCompilerDebug: undefined,
29+
reactCompilerDebug: 'none',
3030
dryRun: false,
3131
stats: false,
3232
};

development/webpack/utils/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,10 @@ function getOptions(
366366
},
367367
reactCompilerDebug: {
368368
array: false,
369-
choices: ['all', 'critical'],
370-
default: undefined,
369+
choices: ['all', 'critical', 'none'],
370+
default: 'none',
371371
description:
372-
'Sets React Compiler panic threshold that fails the build for all errors or critical errors only',
372+
'Sets React Compiler panic threshold that fails the build for all errors or critical errors only. If `none`, the build will not fail.',
373373
group: toOrange('Developer assistance:'),
374374
type: 'string',
375375
},

development/webpack/utils/loaders/reactCompilerLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ export function getReactCompilerLogger(): ReactCompilerLogger {
114114
export const getReactCompilerLoader = (
115115
target: ReactCompilerLoaderOption['target'],
116116
verbose: boolean,
117-
debug: 'all' | 'critical' | undefined,
117+
debug: 'all' | 'critical' | 'none',
118118
) => {
119119
const reactCompilerOptions = {
120120
target,
121121
logger: verbose ? (reactCompilerLogger as Logger) : undefined,
122-
panicThreshold: debug ? `${debug}_errors` : 'none',
122+
panicThreshold: debug === 'none' ? debug : `${debug}_errors`,
123123
} as const satisfies ReactCompilerLoaderOption;
124124

125125
return {

0 commit comments

Comments
 (0)