diff --git a/crates/swc_html_minifier/src/lib.rs b/crates/swc_html_minifier/src/lib.rs index 71090146c537..c56077434120 100644 --- a/crates/swc_html_minifier/src/lib.rs +++ b/crates/swc_html_minifier/src/lib.rs @@ -1937,11 +1937,7 @@ impl Minifier<'_> { match &self.options.minify_js { MinifyJsOption::Bool(_) => JsOptions { parser: JsParserOptions::default(), - minifier: swc_ecma_minifier::option::MinifyOptions { - compress: Some(swc_ecma_minifier::option::CompressOptions::default()), - mangle: Some(swc_ecma_minifier::option::MangleOptions::default()), - ..Default::default() - }, + minifier: swc_ecma_minifier::option::MinifyOptions::default(), codegen: swc_ecma_codegen::Config::default(), }, MinifyJsOption::Options(js_options) => *js_options.clone(), diff --git a/crates/swc_html_minifier/tests/fixture/attribute/disabled-normalize_attributes/output.min.html b/crates/swc_html_minifier/tests/fixture/attribute/disabled-normalize_attributes/output.min.html index 6d7d554503bf..b4c123c2b3cb 100644 --- a/crates/swc_html_minifier/tests/fixture/attribute/disabled-normalize_attributes/output.min.html +++ b/crates/swc_html_minifier/tests/fixture/attribute/disabled-normalize_attributes/output.min.html @@ -1,2 +1,2 @@ Document -
\ No newline at end of file +
\ No newline at end of file diff --git a/crates/swc_html_minifier/tests/fixture/attribute/exportparts/output.min.html b/crates/swc_html_minifier/tests/fixture/attribute/exportparts/output.min.html index 25d0ef832cf3..f817e875050b 100644 --- a/crates/swc_html_minifier/tests/fixture/attribute/exportparts/output.min.html +++ b/crates/swc_html_minifier/tests/fixture/attribute/exportparts/output.min.html @@ -19,4 +19,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/crates/swc_html_minifier/tests/fixture/element/script-group/output.min.html b/crates/swc_html_minifier/tests/fixture/element/script-group/output.min.html index cc09c528dec4..cc2181c05e8d 100644 --- a/crates/swc_html_minifier/tests/fixture/element/script-group/output.min.html +++ b/crates/swc_html_minifier/tests/fixture/element/script-group/output.min.html @@ -1,33 +1,33 @@ Document
breaker
- +
breaker
- +
breaker
- +
breaker
- +
breaker
- +
breaker
- +
breaker
- +
breaker
- +
breaker
@@ -35,26 +35,26 @@
breaker
- +
breaker
- +
breaker
breaker
- +
breaker
- +
breaker
breaker
- +
breaker
@@ -63,31 +63,31 @@
breaker
- +
breaker
breaker
- +
breaker
breaker
- +
breaker
- +
breaker
- +
breaker
breaker
- +
breaker
- \ No newline at end of file + \ No newline at end of file diff --git a/crates/swc_html_minifier/tests/fixture/element/script/input.html b/crates/swc_html_minifier/tests/fixture/element/script/input.html index 85d4becb9c3e..1f3a78154c8e 100644 --- a/crates/swc_html_minifier/tests/fixture/element/script/input.html +++ b/crates/swc_html_minifier/tests/fixture/element/script/input.html @@ -186,5 +186,30 @@

Party coffee cake recipe

test
+
topLevel - script
+ +
topLevel - module
+ + diff --git a/crates/swc_html_minifier/tests/fixture/element/script/output.min.html b/crates/swc_html_minifier/tests/fixture/element/script/output.min.html index ce945121482d..417e9df5121e 100644 --- a/crates/swc_html_minifier/tests/fixture/element/script/output.min.html +++ b/crates/swc_html_minifier/tests/fixture/element/script/output.min.html @@ -19,7 +19,7 @@

Party coffee cake recipe

+

Party coffee cake recipe

by Mary Stone, 2018-03-10

@@ -42,7 +42,7 @@ - + @@ -54,5 +54,10 @@ alert('test') - -
test
\ No newline at end of file + +
test
+ +
topLevel - script
+ +
topLevel - module
+ \ No newline at end of file diff --git a/crates/swc_html_minifier/tests/fixture/text/slot-3/output.min.html b/crates/swc_html_minifier/tests/fixture/text/slot-3/output.min.html index 4e721de55e94..4446bcc1c37b 100644 --- a/crates/swc_html_minifier/tests/fixture/text/slot-3/output.min.html +++ b/crates/swc_html_minifier/tests/fixture/text/slot-3/output.min.html @@ -1 +1 @@ -element-details - web component using <template> and <slot>

element-details - web component using <template> and <slot>

test foo \ No newline at end of file +element-details - web component using <template> and <slot>

element-details - web component using <template> and <slot>

test foo \ No newline at end of file diff --git a/crates/swc_html_minifier/tests/fixture/text/slot/output.min.html b/crates/swc_html_minifier/tests/fixture/text/slot/output.min.html index 877312d0a282..bbaaac670339 100644 --- a/crates/swc_html_minifier/tests/fixture/text/slot/output.min.html +++ b/crates/swc_html_minifier/tests/fixture/text/slot/output.min.html @@ -1 +1 @@ -element-details - web component using <template> and <slot>

element-details - web component using <template> and <slot>

1 2 3 4 \ No newline at end of file +element-details - web component using <template> and <slot>

element-details - web component using <template> and <slot>

1 2 3 4 \ No newline at end of file