Skip to content

Commit 7b98bb5

Browse files
authoredOct 6, 2024··
fix(html/minifier): Fix HTML minifier TS types (#9615)
**Description:** - `preserveComments` is optional but required in the TS type - `removeRedundantAttributes` is an enum and passing a boolean leads to errors See https://github.com/swc-project/swc/blob/main/crates/swc_html_minifier/src/option.rs#L54 **Related issue:** - facebook/docusaurus#10554
1 parent 2480bb0 commit 7b98bb5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎packages/html/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ export type Options = {
1616
| "only-metadata";
1717
removeEmptyMetadataElements?: boolean;
1818
removeComments?: boolean;
19-
preserveComments: string[];
19+
preserveComments?: string[];
2020
minifyConditionalComments?: boolean;
2121
removeEmptyAttributes?: boolean;
22-
removeRedundantAttributes?: boolean;
22+
removeRedundantAttributes?:
23+
| "none"
24+
| "all"
25+
| "smart";
2326
collapseBooleanAttributes?: boolean;
2427
normalizeAttributes?: boolean;
2528
minifyJson?: boolean | { pretty?: boolean };

0 commit comments

Comments
 (0)
Please sign in to comment.