Skip to content

Commit af3c151

Browse files
committed
Consistently overwrite environment
1 parent 4d342b8 commit af3c151

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

packages/next/src/build/get-babel-loader-config.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,14 @@ const getReactCompilerPlugins = (
2424
return undefined
2525
}
2626

27-
const defaultOptions: ReactCompilerOptions & {
28-
environment?: {
29-
enableNameAnonymousFunctions?: EnvironmentConfig['enableNameAnonymousFunctions']
30-
}
31-
} = isDev
32-
? {
33-
environment: {
34-
enableNameAnonymousFunctions: true,
35-
},
36-
}
37-
: {}
27+
const environment: Pick<EnvironmentConfig, 'enableNameAnonymousFunctions'> = {
28+
enableNameAnonymousFunctions: isDev,
29+
}
3830
const options: ReactCompilerOptions =
3931
typeof maybeOptions === 'boolean' ? {} : maybeOptions
4032
const compilerOptions: JSONValue = {
41-
...defaultOptions,
4233
...options,
34+
environment,
4335
}
4436
return [[getReactCompiler(), compilerOptions]]
4537
}

0 commit comments

Comments
 (0)