From 47bd6f5b58597bf6714f046251cb1f23c0ae956b Mon Sep 17 00:00:00 2001 From: cenfun Date: Thu, 25 Jul 2024 07:34:44 +0800 Subject: [PATCH] fix inflateSync --- lib/assets.js | 8 ++++---- package-lock.json | 8 ++++---- package.json | 4 ++-- packages/loader/package.json | 2 +- scripts/conf.cli.js | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/assets.js b/lib/assets.js index 85987440..fc1e9c31 100644 --- a/lib/assets.js +++ b/lib/assets.js @@ -1,18 +1,18 @@ const fs = require('fs'); const path = require('path'); -const { deflateSync, inflateSync } = require('lz-utils'); +const { deflateSync } = require('lz-utils'); const Util = require('./utils/util.js'); const assetsMap = require('./packages/monocart-coverage-assets.js'); const Assets = { getFileContent: (id) => { - const compressed = assetsMap[id]; - if (!compressed) { + const content = assetsMap[id]; + if (!content) { Util.logError(`Not found module: ${id}`); return ''; } - return inflateSync(compressed); + return content; }, saveHtmlReport: async (options) => { diff --git a/package-lock.json b/package-lock.json index a7ed3fff..daacb9da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "find-up": "^7.0.0", "monocart-code-viewer": "^1.1.4", "monocart-formatter": "^3.0.0", - "postcss": "^8.4.39", + "postcss": "^8.4.40", "starfall-cli": "^2.0.20", "stylelint": "^16.7.0", "stylelint-config-plus": "^1.1.2", @@ -9801,9 +9801,9 @@ } }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.4.40", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", + "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 01f339f0..3944a668 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "find-up": "^7.0.0", "monocart-code-viewer": "^1.1.4", "monocart-formatter": "^3.0.0", - "postcss": "^8.4.39", + "postcss": "^8.4.40", "starfall-cli": "^2.0.20", "stylelint": "^16.7.0", "stylelint-config-plus": "^1.1.2", @@ -112,4 +112,4 @@ "vine-ui": "^3.1.16", "ws": "^8.18.0" } -} \ No newline at end of file +} diff --git a/packages/loader/package.json b/packages/loader/package.json index 8ff4b70f..5bb222f3 100644 --- a/packages/loader/package.json +++ b/packages/loader/package.json @@ -9,4 +9,4 @@ "license": "MIT", "dependencies": {}, "devDependencies": {} -} \ No newline at end of file +} diff --git a/scripts/conf.cli.js b/scripts/conf.cli.js index a7771338..45880eb8 100644 --- a/scripts/conf.cli.js +++ b/scripts/conf.cli.js @@ -98,7 +98,7 @@ const buildAssets = (EC, toPath) => { EC.logRed(`Not found asset: ${item.id}`); return; } - assetsMap[item.id] = deflateSync(content); + assetsMap[item.id] = content; } fs.writeFileSync(toJs, `module.exports = ${JSON.stringify(assetsMap, null, 4)};`);