@ecoding/base.build 0.2.7 → 0.2.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.
@@ -1,13 +1,19 @@
1
1
  const fs = require("fs");
2
- const {rootPath} = require("./paths");
2
+ const { rootPath } = require("./paths");
3
3
 
4
4
 
5
5
  const getEntry = (filename) => {
6
6
  const dirPath = rootPath("./src/pages");
7
7
  let pages = fs.readdirSync(dirPath);
8
8
  const pagesObj = {};
9
- pages.forEach((pageName) => {
10
- pagesObj[pageName] = rootPath(`./src/pages/${pageName}/${filename}`);
9
+ pages.forEach((pageName, i) => {
10
+ const filenamePath = rootPath(`./src/pages/${pageName}/${filename}`);
11
+ if (fs.existsSync(filenamePath)) {
12
+ pagesObj[pageName] = filenamePath;
13
+ } else {
14
+ console.log(`warning:not find ${filenamePath}`);
15
+ pages.splice(i, 1);
16
+ }
11
17
  });
12
18
 
13
19
  // 合并mobile文件目录
@@ -18,8 +24,14 @@ const getEntry = (filename) => {
18
24
  mbPages = mbPages.map((pageName) => {
19
25
  return `m${pageName}`
20
26
  });
21
- mbPages.forEach((pageName) => {
22
- pagesObj[pageName] = rootPath(`./src/m/${pageName.replace(/^m/, '')}/${filename}`);
27
+ mbPages.forEach((pageName, i) => {
28
+ const filenamePath = rootPath(`./src/m/${pageName.replace(/^m/, '')}/${filename}`);
29
+ if (fs.existsSync(filenamePath)) {
30
+ pagesObj[pageName] = filenamePath;
31
+ } else {
32
+ console.log(`warning:not find ${filenamePath}`);
33
+ mbPages.splice(i, 1);
34
+ }
23
35
  });
24
36
  }
25
37
  pages = pages.concat(mbPages);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/base.build",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "tpl building",
5
5
  "author": "cxc",
6
6
  "license": "MIT",
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "8c4611b103a9b7366258e386e14a56de90bdb420"
58
+ "gitHead": "9a07dd89c6f832fb0362e3fc3a35ac37bddc0c2b"
59
59
  }