Skip to content

Commit 88bded1

Browse files
chore(minify-literals): upgrade html-minifier-next
Signed-off-by: Henry <mail@henrygressmann.de>
1 parent e21a4c7 commit 88bded1

8 files changed

Lines changed: 34 additions & 24 deletions

File tree

bun.lock

Lines changed: 17 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test": "bun test"
1111
},
1212
"devDependencies": {
13-
"@biomejs/biome": "2.5.0",
13+
"@biomejs/biome": "2.5.1",
1414
"tsdown": "^0.22.3",
1515
"typescript": "^6.0.3",
1616
"bun-types": "^1.3.14"

packages/minify-literals/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/2.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.1.0]
9+
10+
- Updated to `html-minifier-next@7.0.0`
11+
- Added `& Record<string, unknown>` to `HTMLMinifyOptions` and `CSSMinifyOptions` types to allow for additional options and to avoid breaking changes when `html-minifier-next` or `lightningcss` adds new options in the future.
12+
813
## [2.0.2]
914

1015
- Fix stale build artifacts in the npm package.

packages/minify-literals/lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import { type Template, parseTemplates } from "./literals.js";
1414
type MaybePromise<T> = T | Promise<T>;
1515

1616
/** Options passed to `html-minifier-next` for HTML and SVG template literals. */
17-
export type HTMLMinifyOptions = typeof defaultMinifyOptions;
17+
export type HTMLMinifyOptions = typeof defaultMinifyOptions & Record<string, unknown>;
1818

1919
/** Custom HTML minifier used for HTML and SVG template literals. */
2020
export type HTMLMinifier = (html: string) => MaybePromise<string>;
2121

2222
/** Options passed to Lightning CSS for CSS template literals and inline CSS. */
23-
export type CSSMinifyOptions = CSSOptions;
23+
export type CSSMinifyOptions = CSSOptions & Record<string, unknown>;
2424

2525
/** Custom CSS minifier used for CSS template literals and inline CSS. */
2626
export type CSSMinifier = (css: string) => MaybePromise<string>;

packages/minify-literals/lib/minify.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ export const defaultMinifyOptions: HTMLOptions = {
2121
removeAttributeQuotes: false,
2222
removeComments: true,
2323
removeEmptyAttributes: true,
24-
removeScriptTypeAttributes: true,
25-
removeStyleLinkTypeAttributes: true,
24+
removeDefaultTypeAttributes: true,
2625
useShortDoctype: true,
2726
};
2827

packages/minify-literals/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "minify-literals",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "Minify CSS and HTML literals",
55
"keywords": [
66
"literals",
@@ -41,8 +41,8 @@
4141
},
4242
"dependencies": {
4343
"@sveltejs/acorn-typescript": "^1.0.10",
44-
"acorn": "^8.16.0",
45-
"html-minifier-next": "^6.2.8",
44+
"acorn": "^8.17.0",
45+
"html-minifier-next": "^7.0.0",
4646
"lightningcss": "^1.32.0",
4747
"magic-string": "^0.30.21"
4848
},

packages/rollup-plugin-minify-template-literals/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/2.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.1.0]
9+
10+
- Update minify-literals to 2.1.0
11+
812
## [2.0.0]
913

1014
- Update minify-literals to 2.0.0 and simplify plugin options.

packages/rollup-plugin-minify-template-literals/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"dependencies": {
5353
"@rollup/pluginutils": "^5.4.0",
54-
"minify-literals": "^2.0.2"
54+
"minify-literals": "^2.1.0"
5555
},
5656
"devDependencies": {
5757
"rollup": "^4.61.0"

0 commit comments

Comments
 (0)