@jayfong/x-server 2.74.3 → 2.75.0

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.
@@ -59,6 +59,9 @@ class ApiGenerator {
59
59
  // 分类源文件路径
60
60
  const categorySourceFilePath = categorySourceFile.fileName;
61
61
 
62
+ // 忽略仅开发时生效的路由
63
+ if (/@dev[\/\.]/.test(categorySourceFilePath)) continue;
64
+
62
65
  // 分类 URL
63
66
  const categoryUrlMatch = categorySourceFilePath.match(this.categoryUrlRe);
64
67
  let categoryUrl = categoryUrlMatch[1] ?? categoryUrlMatch[2] ?? '';
@@ -127,6 +127,16 @@ class BuildUtil {
127
127
  loader: 'js'
128
128
  };
129
129
  });
130
+
131
+ // 支持仅开发时生效的路由
132
+ build.onLoad({
133
+ filter: /@dev[\/\.]/
134
+ }, async () => {
135
+ return {
136
+ contents: 'export {}',
137
+ loader: 'js'
138
+ };
139
+ });
130
140
  }
131
141
  },
132
142
  // @ts-ignore
@@ -54,6 +54,9 @@ export class ApiGenerator {
54
54
  // 分类源文件路径
55
55
  const categorySourceFilePath = categorySourceFile.fileName;
56
56
 
57
+ // 忽略仅开发时生效的路由
58
+ if (/@dev[\/\.]/.test(categorySourceFilePath)) continue;
59
+
57
60
  // 分类 URL
58
61
  const categoryUrlMatch = categorySourceFilePath.match(this.categoryUrlRe);
59
62
  let categoryUrl = categoryUrlMatch[1] ?? categoryUrlMatch[2] ?? '';
@@ -121,6 +121,16 @@ export class BuildUtil {
121
121
  loader: 'js'
122
122
  };
123
123
  });
124
+
125
+ // 支持仅开发时生效的路由
126
+ build.onLoad({
127
+ filter: /@dev[\/\.]/
128
+ }, async () => {
129
+ return {
130
+ contents: 'export {}',
131
+ loader: 'js'
132
+ };
133
+ });
124
134
  }
125
135
  },
126
136
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.74.3",
3
+ "version": "2.75.0",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",