react-scripts build with CI=true treats the no-useless-concat ESLint warning as an error. DefinePlugin inlining is already prevented by the dynamic process.env[KEY] lookup, so the literal split was unnecessary. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8 lines
464 B
JavaScript
8 lines
464 B
JavaScript
// Dev-tools gate. Explicit opt-in via REACT_APP_DEV_TOOLS=1.
|
|
// Safe default: any value other than exactly '1' = off.
|
|
// Dynamic key access (process.env[KEY]) so react-scripts DefinePlugin does NOT
|
|
// inline the value at build time — allows tests + runtime env changes to take
|
|
// effect. DefinePlugin only replaces static member access, never computed lookups.
|
|
const KEY = 'REACT_APP_DEV_TOOLS';
|
|
export const isDevToolsEnabled = () => process.env[KEY] === '1';
|