Skip to content

Commit

Permalink
chore: bump html-minifier-terser to 7.2.0 (#8991)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laffery authored Jan 22, 2025
1 parent 225a8e8 commit 2276eaa
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 70 deletions.
95 changes: 33 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"@types/d3": "^6.2.0",
"@types/fs-extra": "^11.0.4",
"@types/gulp": "^4.0.7",
"@types/html-minifier-terser": "^7.0.2",
"@types/jasmine": "^5.0.0",
"@types/less": "^3.0.7",
"@types/lodash": "^4.17.14",
Expand All @@ -89,7 +90,7 @@
"fs-extra": "^11.3.0",
"gulp": "^4.0.2",
"gulp-clean": "^0.4.0",
"html-minifier-terser": "^5.1.1",
"html-minifier-terser": "^7.2.0",
"husky": "^9.0.0",
"jasmine": "^5.5.0",
"jasmine-core": "^5.5.0",
Expand Down Expand Up @@ -129,7 +130,7 @@
"stylelint-config-standard": "^37.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.1.0",
"stylelint-order": "^6.0.0",
"terser": "^5.5.1",
"terser": "^5.37.0",
"ts-node": "^10.9.1",
"tslib": "^2.0.3",
"typescript": "~5.7.3",
Expand Down
11 changes: 5 additions & 6 deletions scripts/prerender/minify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
*/

import * as fs from 'fs-extra';
import { minify as jsMinifier } from 'terser';
import { minify as htmlMinifier } from 'html-minifier-terser';
import { minify as jsMinifier, MinifyOptions } from 'terser';

const htmlMinifier = require('html-minifier-terser').minify;

const minifyJsOptions = {
const minifyJsOptions: MinifyOptions = {
keep_classnames: true,
keep_fnames: true,
output: {
format: {
comments: false
}
};

async function minifyJs(content: string): Promise<string> {
return (await jsMinifier(content, minifyJsOptions)).code || '';
return jsMinifier(content, minifyJsOptions).then(({ code }) => code || '');
}

async function minifyHtml(content: string): Promise<string> {
Expand Down

0 comments on commit 2276eaa

Please sign in to comment.