Skip to content

Commit

Permalink
fix(html/minifier): Fix HTML minifier TS types (#9615)
Browse files Browse the repository at this point in the history
**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
  • Loading branch information
slorber authored Oct 6, 2024
1 parent 2480bb0 commit 7b98bb5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/html/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ export type Options = {
| "only-metadata";
removeEmptyMetadataElements?: boolean;
removeComments?: boolean;
preserveComments: string[];
preserveComments?: string[];
minifyConditionalComments?: boolean;
removeEmptyAttributes?: boolean;
removeRedundantAttributes?: boolean;
removeRedundantAttributes?:
| "none"
| "all"
| "smart";
collapseBooleanAttributes?: boolean;
normalizeAttributes?: boolean;
minifyJson?: boolean | { pretty?: boolean };
Expand Down

0 comments on commit 7b98bb5

Please sign in to comment.