Revert HTML minify library

This commit is contained in:
Fred Boniface 2024-04-26 21:40:09 +01:00
parent 222876639c
commit e81a385388
4 changed files with 89 additions and 4 deletions

30
node_modules/.package-lock.json generated vendored
View File

@ -4,6 +4,36 @@
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"node_modules/@minify-html/node": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/@minify-html/node/-/node-0.15.0.tgz",
"integrity": "sha512-ANzt6ZBiqtwrepVXRfa0Qn/woCkINFBjQEKiXyBmg7+51mIFQHVAUbAm6UHRrT0L3xoPG0BX0/XI3NqtjK8Vyg==",
"bin": {
"minify-html": "cli.js"
},
"engines": {
"node": ">= 8.6.0"
},
"optionalDependencies": {
"@minify-html/node-darwin-arm64": "0.15.0",
"@minify-html/node-darwin-x64": "0.15.0",
"@minify-html/node-linux-arm64": "0.15.0",
"@minify-html/node-linux-x64": "0.15.0",
"@minify-html/node-win32-x64": "0.15.0"
}
},
"node_modules/@minify-html/node-linux-x64": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/@minify-html/node-linux-x64/-/node-linux-x64-0.15.0.tgz",
"integrity": "sha512-cO893EV6O9ZHUFX+2Yge546OCo/eCiatjzJDmUmrPP56fQ7pzTRquHs4ko3t8Rg6tMKG7RT49mBuF09JWPnrgg==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/camel-case": { "node_modules/camel-case": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",

55
package-lock.json generated
View File

@ -9,12 +9,67 @@
"version": "0.0.1", "version": "0.0.1",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@minify-html/node": "^0.15.0",
"clean-css": "^5.3.3", "clean-css": "^5.3.3",
"html-minifier": "^4.0.0", "html-minifier": "^4.0.0",
"uglify-js": "^3.17.4", "uglify-js": "^3.17.4",
"zlib": "^1.0.5" "zlib": "^1.0.5"
} }
}, },
"node_modules/@minify-html/node": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/@minify-html/node/-/node-0.15.0.tgz",
"integrity": "sha512-ANzt6ZBiqtwrepVXRfa0Qn/woCkINFBjQEKiXyBmg7+51mIFQHVAUbAm6UHRrT0L3xoPG0BX0/XI3NqtjK8Vyg==",
"bin": {
"minify-html": "cli.js"
},
"engines": {
"node": ">= 8.6.0"
},
"optionalDependencies": {
"@minify-html/node-darwin-arm64": "0.15.0",
"@minify-html/node-darwin-x64": "0.15.0",
"@minify-html/node-linux-arm64": "0.15.0",
"@minify-html/node-linux-x64": "0.15.0",
"@minify-html/node-win32-x64": "0.15.0"
}
},
"node_modules/@minify-html/node-darwin-x64": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/@minify-html/node-darwin-x64/-/node-darwin-x64-0.15.0.tgz",
"integrity": "sha512-D9M9UDku/8I5VEMS0gTLFFQK1DFXK8io+QZvR5cbya4u8NmdDQix/t3EyCR4Wgv/Gfk86gwIS+zfMSvuKcpb5A==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@minify-html/node-linux-x64": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/@minify-html/node-linux-x64/-/node-linux-x64-0.15.0.tgz",
"integrity": "sha512-cO893EV6O9ZHUFX+2Yge546OCo/eCiatjzJDmUmrPP56fQ7pzTRquHs4ko3t8Rg6tMKG7RT49mBuF09JWPnrgg==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@minify-html/node-win32-x64": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/@minify-html/node-win32-x64/-/node-win32-x64-0.15.0.tgz",
"integrity": "sha512-n92IFdtntchlUtyrq13pRI8TT3sOddbzuo4EPTSeocuTJMXaR77v0JYDu0fIjxXNawgGq6nBEeicxAcH4CbvUQ==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
]
},
"node_modules/camel-case": { "node_modules/camel-case": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",

View File

@ -17,8 +17,8 @@
}, },
"homepage": "https://github.com/git.fjla.uk/web-deploy#readme", "homepage": "https://github.com/git.fjla.uk/web-deploy#readme",
"dependencies": { "dependencies": {
"@minify-html/node": "^0.15.0",
"clean-css": "^5.3.3", "clean-css": "^5.3.3",
"html-minifier": "^4.0.0",
"uglify-js": "^3.17.4", "uglify-js": "^3.17.4",
"zlib": "^1.0.5" "zlib": "^1.0.5"
} }

View File

@ -1,4 +1,4 @@
const MinifyHTML = require('html-minifier').minify const MinifyHTML = require('@minify-html/node')
const UglifyJS = require('uglify-js') const UglifyJS = require('uglify-js')
const CleanCss = require('clean-css') const CleanCss = require('clean-css')
const Zlib = require('zlib') const Zlib = require('zlib')
@ -17,9 +17,9 @@ function ensureDirectoryExists(file_path) {
function minifyHtml(input_file, output_file) { function minifyHtml(input_file, output_file) {
const opts = {keep_spaces_between_attributes: true, keep_comments: true} const opts = {keep_spaces_between_attributes: true, keep_comments: true}
const minified = MinifyHTML(fs.readFileSync(input_file, 'utf8'), opts) const minified = MinifyHTML.minify(fs.readFileSync(input_file), opts)
ensureDirectoryExists(output_file) ensureDirectoryExists(output_file)
fs.writeFileSync(output_file, minified, 'utf8') fs.writeFileSync(output_file, minified)
} }
function minifyCss(input_file, output_file) { function minifyCss(input_file, output_file) {