Unverified Commit 5e965bc9 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

fix: Fix regression of swc minifier (#42790)



 - Closes https://github.com/vercel/next.js/issues/42782
parent f5031a48
...@@ -31,9 +31,8 @@ use fxhash::FxHashMap; ...@@ -31,9 +31,8 @@ use fxhash::FxHashMap;
use napi::bindgen_prelude::*; use napi::bindgen_prelude::*;
use serde::Deserialize; use serde::Deserialize;
use swc_core::{ 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}, common::{errors::ColorConfig, sync::Lrc, FileName, SourceFile, SourceMap, GLOBALS},
ecma::minifier::option::terser::TerserCompressorOptions,
}; };
use crate::{get_compiler, util::MapErr}; use crate::{get_compiler, util::MapErr};
...@@ -89,19 +88,7 @@ impl Task for MinifyTask { ...@@ -89,19 +88,7 @@ impl Task for MinifyTask {
GLOBALS.set(&Default::default(), || { GLOBALS.set(&Default::default(), || {
let fm = self.code.to_file(self.c.cm.clone()); let fm = self.code.to_file(self.c.cm.clone());
self.c.minify( self.c.minify(fm, handler, &self.opts)
fm,
handler,
&JsMinifyOptions {
compress: TerserCompressorOptions {
// inline: TerserInlineOption::Num(0).into(),
..Default::default()
}
.into(),
mangle: BoolOrDataConfig::from_bool(false),
..self.opts.clone()
},
)
}) })
}, },
) )
......
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