Skip to content

Commit

Permalink
fix inflateSync
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jul 24, 2024
1 parent 434e842 commit 47bd6f5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions lib/assets.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -112,4 +112,4 @@
"vine-ui": "^3.1.16",
"ws": "^8.18.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"license": "MIT",
"dependencies": {},
"devDependencies": {}
}
}
2 changes: 1 addition & 1 deletion scripts/conf.cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)};`);
Expand Down

0 comments on commit 47bd6f5

Please sign in to comment.