Skip to content

Commit 2c62934

Browse files
committed
shrink source map
1 parent afaaf73 commit 2c62934

File tree

1 file changed

+2
-1
lines changed
  • turbopack/crates/turbopack-ecmascript/src

1 file changed

+2
-1
lines changed

turbopack/crates/turbopack-ecmascript/src/minify.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub async fn minify(
3939
let code = code.await?;
4040

4141
let cm = Arc::new(SwcSourceMap::new(FilePathMapping::empty()));
42-
let (src, src_map_buf) = {
42+
let (src, mut src_map_buf) = {
4343
let compiler = Arc::new(Compiler::new(cm.clone()));
4444
let fm = compiler.cm.new_source_file(
4545
FileName::Custom(path.path.to_string()).into(),
@@ -116,6 +116,7 @@ pub async fn minify(
116116

117117
let mut builder = CodeBuilder::default();
118118
if let Some(original_map) = source_maps {
119+
src_map_buf.shrink_to_fit();
119120
builder.push_source(
120121
&src.into(),
121122
Some(ResolvedVc::upcast(

0 commit comments

Comments
 (0)