Skip to content

Commit 18c61c9

Browse files
committed
refactor(scan): Improve production check condition
1 parent 5ac68af commit 18c61c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/scan/src/core/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,14 @@ export const start = () => {
336336
let isProduction = false;
337337
for (const renderer of rdtHook.renderers.values()) {
338338
const buildType = detectReactBuildType(renderer);
339-
if (
340-
buildType === 'production' &&
341-
!ReactScanInternals.options.value.dangerouslyForceRunInProduction
342-
) {
339+
if (buildType === 'production') {
343340
isProduction = true;
344341
}
345342
}
346-
if (isProduction) {
343+
if (
344+
isProduction &&
345+
!ReactScanInternals.options.value.dangerouslyForceRunInProduction
346+
) {
347347
setOptions({ enabled: false, showToolbar: false });
348348
return;
349349
}

0 commit comments

Comments
 (0)