pug-site-core 1.0.4 → 1.0.5

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 +11 -4
  2. package/package.json +2 -2
package/lib/generate.js CHANGED
@@ -19,7 +19,7 @@ const projectRoot = process.cwd();
19
19
  const configPath = pathToFileURL(path.resolve(projectRoot, "config.js")).href;
20
20
  const { config } = await import(configPath);
21
21
 
22
- const pugRootPath = path.join(projectRoot, "/template/pages");
22
+ const pugRootPath = path.join(projectRoot, "template/pages");
23
23
 
24
24
  /**
25
25
  * 将pages目录下的pug模板编译为JS函数
@@ -34,7 +34,7 @@ export async function compilePagesPugToFn(pugPath) {
34
34
  const fnRootPath = path.join(projectRoot, "/pagesPugFn");
35
35
 
36
36
  // 读取pug运行时代码作为基础代码
37
- const pugRuntimePath = path.join(projectRoot, "pugRuntime.js");
37
+ const pugRuntimePath = path.join(projectRoot, "/lib/pugRuntime.js");
38
38
  const lastPugFnStr = await fse.readFile(pugRuntimePath, "utf8");
39
39
 
40
40
  // 验证指定路径是否存在
@@ -484,8 +484,15 @@ export async function buildStatic() {
484
484
  );
485
485
 
486
486
  await compilePagesPugToFn();
487
- let PagesPugToFn = await import("./pagesPugFn/index.js");
488
- const getData = await import("./getData.js");
487
+ const pagesPugFnPath = pathToFileURL(
488
+ path.resolve(projectRoot, "pagesPugFn/index.js")
489
+ ).href;
490
+ let PagesPugToFn = await import(pagesPugFnPath);
491
+ const getDataPath = pathToFileURL(
492
+ path.resolve(projectRoot, "getData.js")
493
+ ).href;
494
+ const getData = await import(getDataPath);
495
+
489
496
  const fileMapTable = config.fileMapTable;
490
497
  await async.each(config.languageList, async (lang) => {
491
498
  let langDataPath = path.join(jsonDataPath, lang);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pug-site-core",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {},
@@ -27,7 +27,7 @@
27
27
  "ws": "^8.18.0"
28
28
  },
29
29
  "license": "ISC",
30
- "description": "配置参数优化",
30
+ "description": "指令修复",
31
31
  "files": [
32
32
  "lib/",
33
33
  "index.js"