diff --git a/packages/react/babel.ts b/packages/react/babel.ts index 28b0fd3e08732..d943a436b710f 100644 --- a/packages/react/babel.ts +++ b/packages/react/babel.ts @@ -3,6 +3,7 @@ */ interface NxReactBabelOptions { + development?: boolean; runtime?: string; importSource?: string; useBuiltIns?: boolean | string; @@ -51,10 +52,16 @@ module.exports = function (api: any, options: NxReactBabelOptions) { }; }; -function getReactPresetOptions({ presetOptions, env }) { +function getReactPresetOptions({ + presetOptions, + env, +}: { + env: string; + presetOptions: NxReactBabelOptions; +}) { const reactPresetOptions: Record = { runtime: presetOptions.runtime ?? 'automatic', - development: env !== 'production', + development: presetOptions.development ?? env !== 'production', }; // JSX spread is transformed into object spread in `@babel/plugin-transform-react-jsx` diff --git a/packages/web/src/executors/file-server/file-server.impl.ts b/packages/web/src/executors/file-server/file-server.impl.ts index f09afa45e1c60..213e98aec18bc 100644 --- a/packages/web/src/executors/file-server/file-server.impl.ts +++ b/packages/web/src/executors/file-server/file-server.impl.ts @@ -70,7 +70,7 @@ function getBuildTargetOutputPath(options: Schema, context: ExecutorContext) { let buildOptions; try { - const target = parseTargetString(options.buildTarget, context.projectGraph); + const target = parseTargetString(options.buildTarget, context); buildOptions = readTargetOptions(target, context); } catch (e) { throw new Error(`Invalid buildTarget: ${options.buildTarget}`);