pug-site-core 3.0.5 → 3.0.6

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 +9 -0
  2. package/package.json +2 -2
package/lib/generate.js CHANGED
@@ -849,6 +849,15 @@ export async function buildStatic() {
849
849
  console.log("HTML压缩功能已禁用");
850
850
  }
851
851
 
852
+ // 执行初始化函数
853
+ if (getData.init && typeof getData.init === "function") {
854
+ console.log("开始执行init初始化函数...");
855
+ const initStartTime = Date.now();
856
+ await getData.init();
857
+ const initCostTime = (Date.now() - initStartTime) / 1000;
858
+ console.log("初始化函数执行完成,耗时:", initCostTime, "s");
859
+ }
860
+
852
861
  // 处理每种语言
853
862
  await async.eachSeries(config.languageList, async (lang) => {
854
863
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pug-site-core",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -52,7 +52,7 @@
52
52
  "ws": "^8.18.0"
53
53
  },
54
54
  "license": "ISC",
55
- "description": "html文件的压缩功能增加错误堆栈信息",
55
+ "description": "静态打包增加初始化函数的调用",
56
56
  "files": [
57
57
  "lib/",
58
58
  "index.js"