fix(es): Preserve license comments by default (#6703)

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6677.
This commit is contained in:
Donny/강동윤 2022-12-21 18:34:40 +09:00 committed by GitHub
parent 70d8ecc37c
commit 58700f2bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -943,7 +943,7 @@ pub struct JsMinifyFormatOptions {
#[serde(default)]
pub braces: bool,
#[serde(default)]
#[serde(default = "default_comments")]
pub comments: BoolOrDataConfig<JsMinifyCommentOption>,
/// Not implemented yet.
@ -1015,6 +1015,10 @@ pub struct JsMinifyFormatOptions {
pub wrap_func_args: bool,
}
fn default_comments() -> BoolOrDataConfig<JsMinifyCommentOption> {
BoolOrDataConfig::from_obj(JsMinifyCommentOption::PreserveSomeComments)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum JsMinifyCommentOption {
#[serde(rename = "some")]