@jayfong/x-server 1.33.10 → 1.34.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.
|
@@ -51,7 +51,9 @@ class BuildUtil {
|
|
|
51
51
|
const external = (0, _vtils.uniq)(options.external || []);
|
|
52
52
|
const externalWithVersions = (await Promise.all(external.map(async item => {
|
|
53
53
|
try {
|
|
54
|
-
|
|
54
|
+
// 为何不用 require.resolve:
|
|
55
|
+
// Package subpath './package.json' is not defined by "exports"
|
|
56
|
+
const itemPkgFile = _nodePath.default.join(process.cwd(), `node_modules/${item}/package.json`);
|
|
55
57
|
|
|
56
58
|
const itemPkgContent = await _fsExtra.default.readJson(itemPkgFile);
|
|
57
59
|
return {
|
|
@@ -16,7 +16,12 @@ function defineTask(options) {
|
|
|
16
16
|
maxRetriesPerRequest: null,
|
|
17
17
|
enableReadyCheck: false
|
|
18
18
|
},
|
|
19
|
-
prefix: `${_x.x.appId}_task
|
|
19
|
+
prefix: `${_x.x.appId}_task`,
|
|
20
|
+
defaultJobOptions: {
|
|
21
|
+
// 都设为 true 防止占用内存
|
|
22
|
+
removeOnComplete: true,
|
|
23
|
+
removeOnFail: true
|
|
24
|
+
}
|
|
20
25
|
});
|
|
21
26
|
queue.process(options.concurrency || 1, async job => {
|
|
22
27
|
return options.handle(job.data);
|
package/lib/cli/build_util.js
CHANGED
|
@@ -26,8 +26,9 @@ export class BuildUtil {
|
|
|
26
26
|
const external = uniq(options.external || []);
|
|
27
27
|
const externalWithVersions = (await Promise.all(external.map(async item => {
|
|
28
28
|
try {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// 为何不用 require.resolve:
|
|
30
|
+
// Package subpath './package.json' is not defined by "exports"
|
|
31
|
+
const itemPkgFile = path.join(process.cwd(), `node_modules/${item}/package.json`);
|
|
31
32
|
const itemPkgContent = await fs.readJson(itemPkgFile);
|
|
32
33
|
return {
|
|
33
34
|
name: item,
|
package/lib/core/define_task.js
CHANGED
|
@@ -7,7 +7,12 @@ export function defineTask(options) {
|
|
|
7
7
|
maxRetriesPerRequest: null,
|
|
8
8
|
enableReadyCheck: false
|
|
9
9
|
},
|
|
10
|
-
prefix: `${x.appId}_task
|
|
10
|
+
prefix: `${x.appId}_task`,
|
|
11
|
+
defaultJobOptions: {
|
|
12
|
+
// 都设为 true 防止占用内存
|
|
13
|
+
removeOnComplete: true,
|
|
14
|
+
removeOnFail: true
|
|
15
|
+
}
|
|
11
16
|
});
|
|
12
17
|
queue.process(options.concurrency || 1, async job => {
|
|
13
18
|
return options.handle(job.data);
|