Unverified Commit 55046e23 authored by 熊谷 凌's avatar 熊谷 凌 Committed by GitHub

Next-api: Check `client_source_maps` before generate source map (#89915)

parent 8b2b0a6f
......@@ -52,7 +52,7 @@ use turbopack_core::{
asset::AssetContent,
chunk::{
ChunkGroupResult, ChunkingContext, ChunkingContextExt, EvaluatableAsset, EvaluatableAssets,
availability_info::AvailabilityInfo,
SourceMapsType, availability_info::AvailabilityInfo,
},
file_source::FileSource,
ident::{AssetIdent, Layer},
......@@ -1368,13 +1368,19 @@ impl AppEndpoint {
let polyfill_output_asset = ResolvedVc::upcast(polyfill_output);
client_assets.insert(polyfill_output_asset);
let polyfill_source_map_asset = SourceMapAsset::new_fixed(
polyfill_output_path.clone(),
*ResolvedVc::upcast(polyfill_output),
)
.to_resolved()
.await?;
client_assets.insert(ResolvedVc::upcast(polyfill_source_map_asset));
let client_source_maps = project
.next_config()
.client_source_maps(project.next_mode())
.await?;
if *client_source_maps != SourceMapsType::None {
let polyfill_source_map_asset = SourceMapAsset::new_fixed(
polyfill_output_path.clone(),
*ResolvedVc::upcast(polyfill_output),
)
.to_resolved()
.await?;
client_assets.insert(ResolvedVc::upcast(polyfill_source_map_asset));
}
let client_assets: ResolvedVc<OutputAssets> =
ResolvedVc::cell(client_assets.into_iter().collect::<Vec<_>>());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment