Skip to content

Commit

Permalink
fix: Fix regression of swc minifier (#42790)
Browse files Browse the repository at this point in the history
 - Closes #42782
  • Loading branch information
kdy1 committed Nov 11, 2022
1 parent f5031a4 commit 5e965bc
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions packages/next-swc/crates/napi/src/minify.rs
Expand Up @@ -31,9 +31,8 @@ use fxhash::FxHashMap;
use napi::bindgen_prelude::*;
use serde::Deserialize;
use swc_core::{
base::{config::JsMinifyOptions, try_with_handler, BoolOrDataConfig, TransformOutput},
base::{try_with_handler, TransformOutput},
common::{errors::ColorConfig, sync::Lrc, FileName, SourceFile, SourceMap, GLOBALS},
ecma::minifier::option::terser::TerserCompressorOptions,
};

use crate::{get_compiler, util::MapErr};
Expand Down Expand Up @@ -89,19 +88,7 @@ impl Task for MinifyTask {
GLOBALS.set(&Default::default(), || {
let fm = self.code.to_file(self.c.cm.clone());

self.c.minify(
fm,
handler,
&JsMinifyOptions {
compress: TerserCompressorOptions {
// inline: TerserInlineOption::Num(0).into(),
..Default::default()
}
.into(),
mangle: BoolOrDataConfig::from_bool(false),
..self.opts.clone()
},
)
self.c.minify(fm, handler, &self.opts)
})
},
)
Expand Down

0 comments on commit 5e965bc

Please sign in to comment.