@modern-js/plugin-ssg 2.34.0 → 2.35.1
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.
package/dist/cjs/libs/util.js
CHANGED
|
@@ -136,21 +136,18 @@ const standardOptions = (ssgOptions, entrypoints, routes, server) => {
|
|
|
136
136
|
} else if (typeof ssgOptions === "function") {
|
|
137
137
|
const intermediateOptions = {};
|
|
138
138
|
for (const entrypoint of entrypoints) {
|
|
139
|
-
var _server;
|
|
140
139
|
const { entryName } = entrypoint;
|
|
141
|
-
if (Array.isArray(
|
|
140
|
+
if (Array.isArray(server === null || server === void 0 ? void 0 : server.baseUrl)) {
|
|
142
141
|
for (const url of server.baseUrl) {
|
|
143
|
-
var _route;
|
|
144
142
|
const matchUrl = entryName === "main" ? url : `${url}/${entryName}`;
|
|
145
143
|
const route = routes.find((route2) => route2.urlPath === matchUrl);
|
|
146
|
-
intermediateOptions[
|
|
144
|
+
intermediateOptions[route === null || route === void 0 ? void 0 : route.urlPath] = ssgOptions(entryName, {
|
|
147
145
|
baseUrl: url
|
|
148
146
|
});
|
|
149
147
|
}
|
|
150
148
|
} else {
|
|
151
|
-
var _server1;
|
|
152
149
|
intermediateOptions[entryName] = ssgOptions(entryName, {
|
|
153
|
-
baseUrl:
|
|
150
|
+
baseUrl: server === null || server === void 0 ? void 0 : server.baseUrl
|
|
154
151
|
});
|
|
155
152
|
}
|
|
156
153
|
}
|
|
@@ -44,8 +44,7 @@ process.on("message", async (chunk) => {
|
|
|
44
44
|
modernServer.close();
|
|
45
45
|
});
|
|
46
46
|
} catch (e) {
|
|
47
|
-
|
|
48
|
-
(_modernServer = modernServer) === null || _modernServer === void 0 ? void 0 : _modernServer.close();
|
|
47
|
+
modernServer === null || modernServer === void 0 ? void 0 : modernServer.close();
|
|
49
48
|
process.stderr.write(e instanceof Error ? e.stack : e.toString());
|
|
50
49
|
}
|
|
51
50
|
});
|
package/dist/esm/libs/util.js
CHANGED
|
@@ -100,19 +100,17 @@ export var standardOptions = function(ssgOptions, entrypoints, routes, server) {
|
|
|
100
100
|
try {
|
|
101
101
|
var _loop = function() {
|
|
102
102
|
var entrypoint = _step.value;
|
|
103
|
-
var _server;
|
|
104
103
|
var entryName = entrypoint.entryName;
|
|
105
|
-
if (Array.isArray(
|
|
104
|
+
if (Array.isArray(server === null || server === void 0 ? void 0 : server.baseUrl)) {
|
|
106
105
|
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
107
106
|
try {
|
|
108
107
|
var _loop2 = function() {
|
|
109
108
|
var url = _step1.value;
|
|
110
|
-
var _route;
|
|
111
109
|
var matchUrl = entryName === "main" ? url : "".concat(url, "/").concat(entryName);
|
|
112
110
|
var route = routes.find(function(route2) {
|
|
113
111
|
return route2.urlPath === matchUrl;
|
|
114
112
|
});
|
|
115
|
-
intermediateOptions[
|
|
113
|
+
intermediateOptions[route === null || route === void 0 ? void 0 : route.urlPath] = ssgOptions(entryName, {
|
|
116
114
|
baseUrl: url
|
|
117
115
|
});
|
|
118
116
|
};
|
|
@@ -133,9 +131,8 @@ export var standardOptions = function(ssgOptions, entrypoints, routes, server) {
|
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
133
|
} else {
|
|
136
|
-
var _server1;
|
|
137
134
|
intermediateOptions[entryName] = ssgOptions(entryName, {
|
|
138
|
-
baseUrl:
|
|
135
|
+
baseUrl: server === null || server === void 0 ? void 0 : server.baseUrl
|
|
139
136
|
});
|
|
140
137
|
}
|
|
141
138
|
};
|
|
@@ -8,7 +8,7 @@ import { compile as createRender } from "./prerender";
|
|
|
8
8
|
import { CLOSE_SIGN } from "./consts";
|
|
9
9
|
process.on("message", function() {
|
|
10
10
|
var _ref = _async_to_generator(function(chunk) {
|
|
11
|
-
var context, routes, renderRoutes, options, appDirectory, plugins, modernServer, serverOptions, defaultPort, port, e
|
|
11
|
+
var context, routes, renderRoutes, options, appDirectory, plugins, modernServer, serverOptions, defaultPort, port, e;
|
|
12
12
|
return _ts_generator(this, function(_state) {
|
|
13
13
|
switch (_state.label) {
|
|
14
14
|
case 0:
|
|
@@ -90,7 +90,7 @@ process.on("message", function() {
|
|
|
90
90
|
];
|
|
91
91
|
case 4:
|
|
92
92
|
e = _state.sent();
|
|
93
|
-
|
|
93
|
+
modernServer === null || modernServer === void 0 ? void 0 : modernServer.close();
|
|
94
94
|
process.stderr.write(_instanceof(e, Error) ? e.stack : e.toString());
|
|
95
95
|
return [
|
|
96
96
|
3,
|
|
@@ -89,21 +89,18 @@ export const standardOptions = (ssgOptions, entrypoints, routes, server) => {
|
|
|
89
89
|
} else if (typeof ssgOptions === "function") {
|
|
90
90
|
const intermediateOptions = {};
|
|
91
91
|
for (const entrypoint of entrypoints) {
|
|
92
|
-
var _server;
|
|
93
92
|
const { entryName } = entrypoint;
|
|
94
|
-
if (Array.isArray(
|
|
93
|
+
if (Array.isArray(server === null || server === void 0 ? void 0 : server.baseUrl)) {
|
|
95
94
|
for (const url of server.baseUrl) {
|
|
96
|
-
var _route;
|
|
97
95
|
const matchUrl = entryName === "main" ? url : `${url}/${entryName}`;
|
|
98
96
|
const route = routes.find((route2) => route2.urlPath === matchUrl);
|
|
99
|
-
intermediateOptions[
|
|
97
|
+
intermediateOptions[route === null || route === void 0 ? void 0 : route.urlPath] = ssgOptions(entryName, {
|
|
100
98
|
baseUrl: url
|
|
101
99
|
});
|
|
102
100
|
}
|
|
103
101
|
} else {
|
|
104
|
-
var _server1;
|
|
105
102
|
intermediateOptions[entryName] = ssgOptions(entryName, {
|
|
106
|
-
baseUrl:
|
|
103
|
+
baseUrl: server === null || server === void 0 ? void 0 : server.baseUrl
|
|
107
104
|
});
|
|
108
105
|
}
|
|
109
106
|
}
|
|
@@ -39,8 +39,7 @@ process.on("message", async (chunk) => {
|
|
|
39
39
|
modernServer.close();
|
|
40
40
|
});
|
|
41
41
|
} catch (e) {
|
|
42
|
-
|
|
43
|
-
(_modernServer = modernServer) === null || _modernServer === void 0 ? void 0 : _modernServer.close();
|
|
42
|
+
modernServer === null || modernServer === void 0 ? void 0 : modernServer.close();
|
|
44
43
|
process.stderr.write(e instanceof Error ? e.stack : e.toString());
|
|
45
44
|
}
|
|
46
45
|
});
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.35.1",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"normalize-path": "^3.0.0",
|
|
64
64
|
"portfinder": "^1.0.28",
|
|
65
65
|
"@swc/helpers": "0.5.1",
|
|
66
|
-
"@modern-js/utils": "2.
|
|
66
|
+
"@modern-js/utils": "2.35.1"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react-router-dom": ">=5.1.2"
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
"react-dom": "^18",
|
|
82
82
|
"react-router-dom": "^6.8.1",
|
|
83
83
|
"typescript": "^5",
|
|
84
|
-
"@modern-js/
|
|
85
|
-
"@modern-js/app-tools": "2.
|
|
86
|
-
"@modern-js/
|
|
87
|
-
"@scripts/jest-config": "2.
|
|
88
|
-
"@scripts/build": "2.
|
|
84
|
+
"@modern-js/types": "2.35.1",
|
|
85
|
+
"@modern-js/app-tools": "2.35.1",
|
|
86
|
+
"@modern-js/prod-server": "2.35.1",
|
|
87
|
+
"@scripts/jest-config": "2.35.1",
|
|
88
|
+
"@scripts/build": "2.35.1"
|
|
89
89
|
},
|
|
90
90
|
"sideEffects": false,
|
|
91
91
|
"publishConfig": {
|