[babel] Fix default value for environment option

When an `environment` isn't explicitly provided by the user's config, we used to 
default this to `null` in `parsePluginOptions` which is called right at the 
start of the Babel plugin. These parsed options were then being passed to zod, 
which was expecting an object type, not null. 

Zod can reify a default config based on the schema, if an empty object is passed 
in. So by changing our default value to `{}` this should fix the compiler 
bailing out incorrectly on valid compiler options 

Test plan: tested this manually on the external repo by modifying node_modules
This commit is contained in:
Lauren Tan
2023-11-07 18:58:21 -05:00
parent 00cb557b12
commit 9d5ff320ba
@@ -146,7 +146,7 @@ export type Logger = {
export const defaultOptions: PluginOptions = {
compilationMode: "infer",
panicThreshold: "CRITICAL_ERRORS",
environment: null,
environment: {},
logger: null,
gating: null,
instrumentForget: null,