Skip to content

Commit 6eed9a0

Browse files
authored
Turbopack: don't generateBuildId in dev (#86581)
1 parent bfb4a8c commit 6eed9a0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

crates/next-core/src/next_config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@ pub struct NextConfig {
141141
compress: bool,
142142
eslint: EslintConfig,
143143
exclude_default_moment_locales: bool,
144-
// this can be a function in js land
145-
export_path_map: Option<serde_json::Value>,
146-
// this is a function in js land
147-
generate_build_id: Option<serde_json::Value>,
148144
generate_etags: bool,
149145
http_agent_options: HttpAgentConfig,
150146
on_demand_entries: OnDemandEntriesConfig,
@@ -156,7 +152,11 @@ pub struct NextConfig {
156152
typescript: TypeScriptConfig,
157153
use_file_system_public_routes: bool,
158154
cache_components: Option<bool>,
159-
webpack: Option<serde_json::Value>,
155+
//
156+
// These are never used by Turbopack, and potentially non-serializable anyway:
157+
// export_path_map: Option<serde_json::Value>,
158+
// generate_build_id: Option<serde_json::Value>,
159+
// webpack: Option<serde_json::Value>,
160160
}
161161

162162
#[turbo_tasks::value_impl]

packages/next/src/build/swc/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,10 @@ function bindingToApi(
852852
// Avoid mutating the existing `nextConfig` object. NOTE: This is only a shallow clone.
853853
let nextConfigSerializable: Record<string, any> = { ...nextConfig }
854854

855-
nextConfigSerializable.generateBuildId =
856-
await nextConfigSerializable.generateBuildId?.()
857-
858-
// TODO: these functions takes arguments, have to be supported in a different way
855+
// These values are never read by Turbopack and are potentially non-serializable.
859856
nextConfigSerializable.exportPathMap = {}
857+
nextConfigSerializable.generateBuildId =
858+
nextConfigSerializable.generateBuildId && {}
860859
nextConfigSerializable.webpack = nextConfigSerializable.webpack && {}
861860

862861
if (nextConfigSerializable.modularizeImports) {

0 commit comments

Comments
 (0)