pug-site-core 2.0.9 → 2.0.11

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 +8 -8
  2. package/package.json +4 -3
package/lib/generate.js CHANGED
@@ -213,11 +213,11 @@ export async function fetchDataToJsonFile(args) {
213
213
 
214
214
  // 执行初始化函数
215
215
  if (getData.init && typeof getData.init === "function") {
216
- console.log("开始执行init初始化函数");
216
+ console.log("开始执行init初始化函数...");
217
217
  const initStartTime = Date.now();
218
218
  await getData.init();
219
219
  const initCostTime = (Date.now() - initStartTime) / 1000;
220
- console.log("初始化函数执行完成,耗时:", initCostTime, "s");
220
+ console.log("初始化函数执行完成,耗时:", initCostTime, "s");
221
221
  }
222
222
 
223
223
  const pugFilePathList = await getPagesPugFilePathArr();
@@ -387,12 +387,12 @@ export async function fetchDataToJsonFile(args) {
387
387
  }
388
388
 
389
389
  export async function buildFn() {
390
- const jsonDataPath = paths.resolveRoot("jsonData");
391
- if (!fse.pathExistsSync(jsonDataPath)) {
392
- return Promise.reject(
393
- new Error(jsonDataPath + "目录不存在请先执行npm run getData生成数据!")
394
- );
395
- }
390
+ // const jsonDataPath = paths.resolveRoot("jsonData");
391
+ // if (!fse.pathExistsSync(jsonDataPath)) {
392
+ // return Promise.reject(
393
+ // new Error(jsonDataPath + "目录不存在请先执行npm run getData生成数据!")
394
+ // );
395
+ // }
396
396
  console.log("开始打包...");
397
397
  let starTime = Date.now();
398
398
  let outputPath = paths.resolveRoot(config.fnOutput);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pug-site-core",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -11,7 +11,8 @@
11
11
  "buildFn": "node index.js",
12
12
  "buildStatic": "node index.js",
13
13
  "lang": "node index.js",
14
- "build": "npm run getData && npm run buildFn"
14
+ "build": "npm run getData && npm run buildFn",
15
+ "update": "npm install pug-site-core@latest"
15
16
  },
16
17
  "keywords": [],
17
18
  "author": "xy",
@@ -37,7 +38,7 @@
37
38
  "axios": "^1.7.7"
38
39
  },
39
40
  "license": "ISC",
40
- "description": "优化注入函数的判断、添加init函数",
41
+ "description": "取消buildFn打包需要jsonData目录",
41
42
  "files": [
42
43
  "lib/",
43
44
  "index.js"