Skip to content

Commit 1470e3d

Browse files
committed
Turbopack: respect productionBrowserSourceMaps
1 parent fb8376a commit 1470e3d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/next-core/src/next_config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,12 +1510,12 @@ impl NextConfig {
15101510
}
15111511

15121512
#[turbo_tasks::function]
1513-
pub async fn client_source_maps(&self, _mode: Vc<NextMode>) -> Result<Vc<bool>> {
1514-
// Temporarily always enable client source maps as tests regress.
1515-
// TODO: Respect both `self.experimental.turbopack_source_maps` and
1516-
// `self.production_browser_source_maps`
1513+
pub async fn client_source_maps(&self, mode: Vc<NextMode>) -> Result<Vc<bool>> {
15171514
let source_maps = self.experimental.turbopack_source_maps;
1518-
Ok(Vc::cell(source_maps.unwrap_or(true)))
1515+
Ok(Vc::cell(source_maps.unwrap_or(match &*mode.await? {
1516+
NextMode::Development => true,
1517+
NextMode::Build => self.production_browser_source_maps,
1518+
})))
15191519
}
15201520

15211521
#[turbo_tasks::function]

0 commit comments

Comments
 (0)