From ef83eab14b713e4707bbac729aca26c737d0c5f7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Dec 2024 15:48:26 +0000 Subject: [PATCH 1/4] chore(deps): update dependency terser to v5 --- package-lock.json | 65 ++++++----------------------------------------- package.json | 2 +- 2 files changed, 9 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index ac7b9f5..eefcb81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "ejs": "^3.1.10", "html-minifier-terser": "^7.2.0", - "terser": "^4.8.1" + "terser": "^5.0.0" }, "devDependencies": { "@myrotvorets/eslint-config-myrotvorets-ts": "^3.0.2", @@ -4906,30 +4906,6 @@ "node": "^14.13.1 || >=16.0.0" } }, - "node_modules/html-minifier-terser/node_modules/terser": { - "version": "5.37.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", - "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", - "license": "BSD-2-Clause", - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/html-minifier-terser/node_modules/terser/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "license": "MIT" - }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -7039,20 +7015,21 @@ } }, "node_modules/terser": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", - "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", + "version": "5.37.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", + "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", "license": "BSD-2-Clause", "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" + "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" } }, "node_modules/terser-webpack-plugin": { @@ -7120,13 +7097,6 @@ "ajv": "^8.8.2" } }, - "node_modules/terser-webpack-plugin/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "license": "MIT" - }, "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -7154,25 +7124,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/terser-webpack-plugin/node_modules/terser": { - "version": "5.37.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", - "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", diff --git a/package.json b/package.json index 357777c..637fa48 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "dependencies": { "ejs": "^3.1.10", "html-minifier-terser": "^7.2.0", - "terser": "^4.8.1" + "terser": "^5.0.0" }, "devDependencies": { "@myrotvorets/eslint-config-myrotvorets-ts": "^3.0.2", From abd57898d8f397fee45230a92d81a8e3832aa537 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Sun, 22 Dec 2024 17:51:48 +0200 Subject: [PATCH 2/4] Update code --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3cd151e..112b1b0 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,7 @@ module.exports = function (source, sourceMaps, meta) { // minify js with terser if (opts.minimize) { - template = terser.minify(template, opts.terserOptions).code + ''; + template = (await terser.minify(template, opts.terserOptions)).code ?? ''; } callback(null, 'module.exports = ' + template, sourceMaps, meta); From b92fed7275417d3fbdcd5a0460d86c796fc95b0f Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Sun, 22 Dec 2024 17:54:22 +0200 Subject: [PATCH 3/4] Update eslint config --- eslint.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index 8a24103..be63830 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -9,6 +9,7 @@ export default [ ...Config, { languageOptions: { + ecmaVersion: 2020, globals: { ...globals.node, }, From 635a52e3272f273a135b8641b871390e4a3fe951 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Sun, 22 Dec 2024 17:54:41 +0200 Subject: [PATCH 4/4] Update terser version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index eefcb81..a33ee8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "ejs": "^3.1.10", "html-minifier-terser": "^7.2.0", - "terser": "^5.0.0" + "terser": "^5.37.0" }, "devDependencies": { "@myrotvorets/eslint-config-myrotvorets-ts": "^3.0.2", diff --git a/package.json b/package.json index 637fa48..99bb504 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "dependencies": { "ejs": "^3.1.10", "html-minifier-terser": "^7.2.0", - "terser": "^5.0.0" + "terser": "^5.37.0" }, "devDependencies": { "@myrotvorets/eslint-config-myrotvorets-ts": "^3.0.2",