pug-site-core 2.0.6 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/generate.js +5 -3
  2. package/package.json +2 -2
package/lib/generate.js CHANGED
@@ -139,6 +139,9 @@ export async function generateGetDataFn() {
139
139
  */
140
140
  export async function fetchDataToJsonFile(args) {
141
141
  try {
142
+ console.log("开始获取数据...");
143
+ let starTime = Date.now();
144
+
142
145
  // 解析过滤参数,使用对象解构使代码更清晰
143
146
  const { filterFun, filterLang } = args.reduce(
144
147
  (acc, item) => {
@@ -346,6 +349,7 @@ export async function fetchDataToJsonFile(args) {
346
349
  // 等待所有任务完成
347
350
  return new Promise((resolve, reject) => {
348
351
  queue.drain(() => {
352
+ console.log("获取数据并写入完成花费:", (Date.now() - starTime) / 1000, "s");
349
353
  resolve();
350
354
  });
351
355
 
@@ -388,9 +392,7 @@ export async function buildFn() {
388
392
  let totalCommonData = {};
389
393
  totalCommonData.langCommon = config.commonData;
390
394
  await async.each(config.languageList, async (lang) => {
391
- let commonData = await fse.readJSON(
392
- paths.resolveRoot("jsonData", lang, "_common.json")
393
- );
395
+ let commonData = await (await import(paths.getData))["get_common_data"](lang);
394
396
  totalCommonData[lang] = commonData;
395
397
  });
396
398
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pug-site-core",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -37,7 +37,7 @@
37
37
  "axios": "^1.7.7"
38
38
  },
39
39
  "license": "ISC",
40
- "description": "优化并发写入json文件",
40
+ "description": "修改打包方法",
41
41
  "files": [
42
42
  "lib/",
43
43
  "index.js"