Skip to content

Commit 9b03d00

Browse files
committed
Turbopack: respect productionBrowserSourceMaps
1 parent 7af1b0a commit 9b03d00

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
@@ -1701,12 +1701,12 @@ impl NextConfig {
17011701
}
17021702

17031703
#[turbo_tasks::function]
1704-
pub fn client_source_maps(&self, _mode: Vc<NextMode>) -> Result<Vc<bool>> {
1705-
// Temporarily always enable client source maps as tests regress.
1706-
// TODO: Respect both `self.experimental.turbopack_source_maps` and
1707-
// `self.production_browser_source_maps`
1704+
pub async fn client_source_maps(&self, mode: Vc<NextMode>) -> Result<Vc<bool>> {
17081705
let source_maps = self.experimental.turbopack_source_maps;
1709-
Ok(Vc::cell(source_maps.unwrap_or(true)))
1706+
Ok(Vc::cell(source_maps.unwrap_or(match &*mode.await? {
1707+
NextMode::Development => true,
1708+
NextMode::Build => self.production_browser_source_maps,
1709+
})))
17101710
}
17111711

17121712
#[turbo_tasks::function]

0 commit comments

Comments
 (0)