@modern-js/app-tools 2.42.1 → 2.42.2
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/analyze/nestedRoutes.js +21 -20
- package/dist/cjs/config/initialize/inits.js +3 -2
- package/dist/esm/analyze/nestedRoutes.js +22 -21
- package/dist/esm/config/initialize/inits.js +3 -2
- package/dist/esm-node/analyze/nestedRoutes.js +21 -20
- package/dist/esm-node/config/initialize/inits.js +3 -2
- package/package.json +24 -24
@@ -143,6 +143,7 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
143
143
|
const items = await import_utils.fs.readdir(dirname);
|
144
144
|
for (const item of items) {
|
145
145
|
const itemPath = path.join(dirname, item);
|
146
|
+
const itemPathWithAlias = (0, import_utils2.replaceWithAlias)(alias.basename, itemPath, alias.name);
|
146
147
|
const extname = path.extname(item);
|
147
148
|
const itemWithoutExt = item.slice(0, -extname.length);
|
148
149
|
const isDirectory2 = (await import_utils.fs.stat(itemPath)).isDirectory();
|
@@ -158,45 +159,45 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
158
159
|
}
|
159
160
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.LAYOUT_LOADER_FILE) {
|
160
161
|
if (!route.loader) {
|
161
|
-
route.loader =
|
162
|
+
route.loader = itemPathWithAlias;
|
162
163
|
}
|
163
164
|
}
|
164
165
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.LAYOUT_CLIENT_LOADER) {
|
165
|
-
route.clientData =
|
166
|
+
route.clientData = itemPathWithAlias;
|
166
167
|
}
|
167
168
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.LAYOUT_DATA_FILE) {
|
168
|
-
route.data =
|
169
|
+
route.data = itemPathWithAlias;
|
169
170
|
if (await (0, import_utils2.hasAction)(itemPath)) {
|
170
|
-
route.action =
|
171
|
+
route.action = itemPathWithAlias;
|
171
172
|
}
|
172
173
|
}
|
173
174
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.LAYOUT_CONFIG_FILE) {
|
174
175
|
if (!route.config) {
|
175
|
-
route.config =
|
176
|
+
route.config = itemPathWithAlias;
|
176
177
|
}
|
177
178
|
}
|
178
179
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.LAYOUT_FILE) {
|
179
|
-
route._component =
|
180
|
+
route._component = itemPathWithAlias;
|
180
181
|
}
|
181
182
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.PAGE_LOADER_FILE) {
|
182
|
-
pageLoaderFile =
|
183
|
+
pageLoaderFile = itemPathWithAlias;
|
183
184
|
}
|
184
185
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.PAGE_CLIENT_LOADER) {
|
185
|
-
pageClientData =
|
186
|
+
pageClientData = itemPathWithAlias;
|
186
187
|
}
|
187
188
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.PAGE_DATA_FILE) {
|
188
|
-
pageData =
|
189
|
+
pageData = itemPathWithAlias;
|
189
190
|
if (await (0, import_utils2.hasAction)(itemPath)) {
|
190
|
-
pageAction =
|
191
|
+
pageAction = itemPathWithAlias;
|
191
192
|
}
|
192
193
|
}
|
193
194
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.PAGE_CONFIG_FILE) {
|
194
|
-
pageConfigFile =
|
195
|
+
pageConfigFile = itemPathWithAlias;
|
195
196
|
}
|
196
197
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.PAGE_FILE) {
|
197
198
|
var _route_children1;
|
198
199
|
pageRoute = createIndexRoute({
|
199
|
-
_component:
|
200
|
+
_component: itemPathWithAlias
|
200
201
|
}, rootDir, itemPath, entryName, isMainEntry);
|
201
202
|
if (pageLoaderFile) {
|
202
203
|
pageRoute.loader = pageLoaderFile;
|
@@ -216,26 +217,26 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
216
217
|
(_route_children1 = route.children) === null || _route_children1 === void 0 ? void 0 : _route_children1.push(pageRoute);
|
217
218
|
}
|
218
219
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
219
|
-
splatLoaderFile =
|
220
|
+
splatLoaderFile = itemPathWithAlias;
|
220
221
|
}
|
221
222
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_CLIENT_DATA) {
|
222
|
-
splatClientData =
|
223
|
+
splatClientData = itemPathWithAlias;
|
223
224
|
}
|
224
225
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_CONFIG_FILE) {
|
225
226
|
if (!route.config) {
|
226
|
-
splatConfigFile = itemPath;
|
227
|
+
splatConfigFile = (0, import_utils2.replaceWithAlias)(alias.basename, itemPath, alias.name);
|
227
228
|
}
|
228
229
|
}
|
229
230
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_DATA_FILE) {
|
230
|
-
splatData =
|
231
|
+
splatData = itemPathWithAlias;
|
231
232
|
if (await (0, import_utils2.hasAction)(itemPath)) {
|
232
|
-
splatAction =
|
233
|
+
splatAction = itemPathWithAlias;
|
233
234
|
}
|
234
235
|
}
|
235
236
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_FILE) {
|
236
237
|
var _route_children2;
|
237
238
|
splatRoute = createRoute({
|
238
|
-
_component:
|
239
|
+
_component: itemPathWithAlias,
|
239
240
|
path: "*"
|
240
241
|
}, rootDir, itemPath, entryName, isMainEntry);
|
241
242
|
if (splatLoaderFile) {
|
@@ -256,10 +257,10 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
256
257
|
(_route_children2 = route.children) === null || _route_children2 === void 0 ? void 0 : _route_children2.push(splatRoute);
|
257
258
|
}
|
258
259
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.LOADING_FILE) {
|
259
|
-
route.loading =
|
260
|
+
route.loading = itemPathWithAlias;
|
260
261
|
}
|
261
262
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.ERROR_FILE) {
|
262
|
-
route.error =
|
263
|
+
route.error = itemPathWithAlias;
|
263
264
|
}
|
264
265
|
}
|
265
266
|
let finalRoute = createRoute(route, rootDir, path.join(dirname, `${import_constants.NESTED_ROUTE.LAYOUT_FILE}.ts`), entryName, isMainEntry);
|
@@ -47,9 +47,10 @@ function initHtmlConfig(config, appContext) {
|
|
47
47
|
config.html.favicon = createBuilderFavicon(config, appContext);
|
48
48
|
return config.html;
|
49
49
|
function createBuilderAppIcon(config2, appContext2) {
|
50
|
+
const { appIcon } = config2.html;
|
50
51
|
const { configDir } = config2.source;
|
51
|
-
const
|
52
|
-
return
|
52
|
+
const defaultAppIcon = (0, import_utils.findExists)(ICON_EXTENSIONS.map((ext) => import_path.default.resolve(appContext2.appDirectory, configDir || "./config", `icon.${ext}`)));
|
53
|
+
return appIcon || defaultAppIcon || void 0;
|
53
54
|
}
|
54
55
|
function createBuilderFavicon(config2, appContext2) {
|
55
56
|
const { configDir } = config2.source;
|
@@ -70,7 +70,7 @@ var optimizeRoute = function(routeTree) {
|
|
70
70
|
};
|
71
71
|
var walk = function() {
|
72
72
|
var _ref = _async_to_generator(function(dirname, rootDir, alias, entryName, isMainEntry, oldVersion) {
|
73
|
-
var _finalRoute_children, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, pageConfigFile, pageClientData, pageData, pageAction, splatLoaderFile, splatRoute, splatConfigFile, splatClientData, splatData, splatAction, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, extname, itemWithoutExt, isDirectory1, childRoute, _route_children, _route_children1, _route_children2, err, finalRoute, childRoutes, childRoute1, _$path, optimizedRoutes;
|
73
|
+
var _finalRoute_children, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, pageConfigFile, pageClientData, pageData, pageAction, splatLoaderFile, splatRoute, splatConfigFile, splatClientData, splatData, splatAction, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, itemPathWithAlias, extname, itemWithoutExt, isDirectory1, childRoute, _route_children, _route_children1, _route_children2, err, finalRoute, childRoutes, childRoute1, _$path, optimizedRoutes;
|
74
74
|
return _ts_generator(this, function(_state) {
|
75
75
|
switch (_state.label) {
|
76
76
|
case 0:
|
@@ -150,6 +150,7 @@ var walk = function() {
|
|
150
150
|
];
|
151
151
|
item = _step.value;
|
152
152
|
itemPath = path.join(dirname, item);
|
153
|
+
itemPathWithAlias = replaceWithAlias(alias.basename, itemPath, alias.name);
|
153
154
|
extname = path.extname(item);
|
154
155
|
itemWithoutExt = item.slice(0, -extname.length);
|
155
156
|
return [
|
@@ -183,65 +184,65 @@ var walk = function() {
|
|
183
184
|
}
|
184
185
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_LOADER_FILE) {
|
185
186
|
if (!route.loader) {
|
186
|
-
route.loader =
|
187
|
+
route.loader = itemPathWithAlias;
|
187
188
|
}
|
188
189
|
}
|
189
190
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CLIENT_LOADER) {
|
190
|
-
route.clientData =
|
191
|
+
route.clientData = itemPathWithAlias;
|
191
192
|
}
|
192
193
|
if (!(itemWithoutExt === NESTED_ROUTE.LAYOUT_DATA_FILE))
|
193
194
|
return [
|
194
195
|
3,
|
195
196
|
10
|
196
197
|
];
|
197
|
-
route.data =
|
198
|
+
route.data = itemPathWithAlias;
|
198
199
|
return [
|
199
200
|
4,
|
200
201
|
hasAction(itemPath)
|
201
202
|
];
|
202
203
|
case 9:
|
203
204
|
if (_state.sent()) {
|
204
|
-
route.action =
|
205
|
+
route.action = itemPathWithAlias;
|
205
206
|
}
|
206
207
|
_state.label = 10;
|
207
208
|
case 10:
|
208
209
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CONFIG_FILE) {
|
209
210
|
if (!route.config) {
|
210
|
-
route.config =
|
211
|
+
route.config = itemPathWithAlias;
|
211
212
|
}
|
212
213
|
}
|
213
214
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_FILE) {
|
214
|
-
route._component =
|
215
|
+
route._component = itemPathWithAlias;
|
215
216
|
}
|
216
217
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_LOADER_FILE) {
|
217
|
-
pageLoaderFile =
|
218
|
+
pageLoaderFile = itemPathWithAlias;
|
218
219
|
}
|
219
220
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_CLIENT_LOADER) {
|
220
|
-
pageClientData =
|
221
|
+
pageClientData = itemPathWithAlias;
|
221
222
|
}
|
222
223
|
if (!(itemWithoutExt === NESTED_ROUTE.PAGE_DATA_FILE))
|
223
224
|
return [
|
224
225
|
3,
|
225
226
|
12
|
226
227
|
];
|
227
|
-
pageData =
|
228
|
+
pageData = itemPathWithAlias;
|
228
229
|
return [
|
229
230
|
4,
|
230
231
|
hasAction(itemPath)
|
231
232
|
];
|
232
233
|
case 11:
|
233
234
|
if (_state.sent()) {
|
234
|
-
pageAction =
|
235
|
+
pageAction = itemPathWithAlias;
|
235
236
|
}
|
236
237
|
_state.label = 12;
|
237
238
|
case 12:
|
238
239
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_CONFIG_FILE) {
|
239
|
-
pageConfigFile =
|
240
|
+
pageConfigFile = itemPathWithAlias;
|
240
241
|
}
|
241
242
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_FILE) {
|
242
243
|
;
|
243
244
|
pageRoute = createIndexRoute({
|
244
|
-
_component:
|
245
|
+
_component: itemPathWithAlias
|
245
246
|
}, rootDir, itemPath, entryName, isMainEntry);
|
246
247
|
if (pageLoaderFile) {
|
247
248
|
pageRoute.loader = pageLoaderFile;
|
@@ -261,14 +262,14 @@ var walk = function() {
|
|
261
262
|
(_route_children1 = route.children) === null || _route_children1 === void 0 ? void 0 : _route_children1.push(pageRoute);
|
262
263
|
}
|
263
264
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
264
|
-
splatLoaderFile =
|
265
|
+
splatLoaderFile = itemPathWithAlias;
|
265
266
|
}
|
266
267
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_CLIENT_DATA) {
|
267
|
-
splatClientData =
|
268
|
+
splatClientData = itemPathWithAlias;
|
268
269
|
}
|
269
270
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_CONFIG_FILE) {
|
270
271
|
if (!route.config) {
|
271
|
-
splatConfigFile = itemPath;
|
272
|
+
splatConfigFile = replaceWithAlias(alias.basename, itemPath, alias.name);
|
272
273
|
}
|
273
274
|
}
|
274
275
|
if (!(itemWithoutExt === NESTED_ROUTE.SPLATE_DATA_FILE))
|
@@ -276,21 +277,21 @@ var walk = function() {
|
|
276
277
|
3,
|
277
278
|
14
|
278
279
|
];
|
279
|
-
splatData =
|
280
|
+
splatData = itemPathWithAlias;
|
280
281
|
return [
|
281
282
|
4,
|
282
283
|
hasAction(itemPath)
|
283
284
|
];
|
284
285
|
case 13:
|
285
286
|
if (_state.sent()) {
|
286
|
-
splatAction =
|
287
|
+
splatAction = itemPathWithAlias;
|
287
288
|
}
|
288
289
|
_state.label = 14;
|
289
290
|
case 14:
|
290
291
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
|
291
292
|
;
|
292
293
|
splatRoute = createRoute({
|
293
|
-
_component:
|
294
|
+
_component: itemPathWithAlias,
|
294
295
|
path: "*"
|
295
296
|
}, rootDir, itemPath, entryName, isMainEntry);
|
296
297
|
if (splatLoaderFile) {
|
@@ -311,10 +312,10 @@ var walk = function() {
|
|
311
312
|
(_route_children2 = route.children) === null || _route_children2 === void 0 ? void 0 : _route_children2.push(splatRoute);
|
312
313
|
}
|
313
314
|
if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
|
314
|
-
route.loading =
|
315
|
+
route.loading = itemPathWithAlias;
|
315
316
|
}
|
316
317
|
if (itemWithoutExt === NESTED_ROUTE.ERROR_FILE) {
|
317
|
-
route.error =
|
318
|
+
route.error = itemPathWithAlias;
|
318
319
|
}
|
319
320
|
_state.label = 15;
|
320
321
|
case 15:
|
@@ -12,11 +12,12 @@ function initHtmlConfig(config, appContext) {
|
|
12
12
|
config.html.favicon = createBuilderFavicon(config, appContext);
|
13
13
|
return config.html;
|
14
14
|
function createBuilderAppIcon(config2, appContext2) {
|
15
|
+
var appIcon = config2.html.appIcon;
|
15
16
|
var configDir = config2.source.configDir;
|
16
|
-
var
|
17
|
+
var defaultAppIcon = findExists(ICON_EXTENSIONS.map(function(ext) {
|
17
18
|
return path.resolve(appContext2.appDirectory, configDir || "./config", "icon.".concat(ext));
|
18
19
|
}));
|
19
|
-
return
|
20
|
+
return appIcon || defaultAppIcon || void 0;
|
20
21
|
}
|
21
22
|
function createBuilderFavicon(config2, appContext2) {
|
22
23
|
var configDir = config2.source.configDir;
|
@@ -108,6 +108,7 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
108
108
|
const items = await fs.readdir(dirname);
|
109
109
|
for (const item of items) {
|
110
110
|
const itemPath = path.join(dirname, item);
|
111
|
+
const itemPathWithAlias = replaceWithAlias(alias.basename, itemPath, alias.name);
|
111
112
|
const extname = path.extname(item);
|
112
113
|
const itemWithoutExt = item.slice(0, -extname.length);
|
113
114
|
const isDirectory2 = (await fs.stat(itemPath)).isDirectory();
|
@@ -123,45 +124,45 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
123
124
|
}
|
124
125
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_LOADER_FILE) {
|
125
126
|
if (!route.loader) {
|
126
|
-
route.loader =
|
127
|
+
route.loader = itemPathWithAlias;
|
127
128
|
}
|
128
129
|
}
|
129
130
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CLIENT_LOADER) {
|
130
|
-
route.clientData =
|
131
|
+
route.clientData = itemPathWithAlias;
|
131
132
|
}
|
132
133
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_DATA_FILE) {
|
133
|
-
route.data =
|
134
|
+
route.data = itemPathWithAlias;
|
134
135
|
if (await hasAction(itemPath)) {
|
135
|
-
route.action =
|
136
|
+
route.action = itemPathWithAlias;
|
136
137
|
}
|
137
138
|
}
|
138
139
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CONFIG_FILE) {
|
139
140
|
if (!route.config) {
|
140
|
-
route.config =
|
141
|
+
route.config = itemPathWithAlias;
|
141
142
|
}
|
142
143
|
}
|
143
144
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_FILE) {
|
144
|
-
route._component =
|
145
|
+
route._component = itemPathWithAlias;
|
145
146
|
}
|
146
147
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_LOADER_FILE) {
|
147
|
-
pageLoaderFile =
|
148
|
+
pageLoaderFile = itemPathWithAlias;
|
148
149
|
}
|
149
150
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_CLIENT_LOADER) {
|
150
|
-
pageClientData =
|
151
|
+
pageClientData = itemPathWithAlias;
|
151
152
|
}
|
152
153
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_DATA_FILE) {
|
153
|
-
pageData =
|
154
|
+
pageData = itemPathWithAlias;
|
154
155
|
if (await hasAction(itemPath)) {
|
155
|
-
pageAction =
|
156
|
+
pageAction = itemPathWithAlias;
|
156
157
|
}
|
157
158
|
}
|
158
159
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_CONFIG_FILE) {
|
159
|
-
pageConfigFile =
|
160
|
+
pageConfigFile = itemPathWithAlias;
|
160
161
|
}
|
161
162
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_FILE) {
|
162
163
|
var _route_children1;
|
163
164
|
pageRoute = createIndexRoute({
|
164
|
-
_component:
|
165
|
+
_component: itemPathWithAlias
|
165
166
|
}, rootDir, itemPath, entryName, isMainEntry);
|
166
167
|
if (pageLoaderFile) {
|
167
168
|
pageRoute.loader = pageLoaderFile;
|
@@ -181,26 +182,26 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
181
182
|
(_route_children1 = route.children) === null || _route_children1 === void 0 ? void 0 : _route_children1.push(pageRoute);
|
182
183
|
}
|
183
184
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
184
|
-
splatLoaderFile =
|
185
|
+
splatLoaderFile = itemPathWithAlias;
|
185
186
|
}
|
186
187
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_CLIENT_DATA) {
|
187
|
-
splatClientData =
|
188
|
+
splatClientData = itemPathWithAlias;
|
188
189
|
}
|
189
190
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_CONFIG_FILE) {
|
190
191
|
if (!route.config) {
|
191
|
-
splatConfigFile = itemPath;
|
192
|
+
splatConfigFile = replaceWithAlias(alias.basename, itemPath, alias.name);
|
192
193
|
}
|
193
194
|
}
|
194
195
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_DATA_FILE) {
|
195
|
-
splatData =
|
196
|
+
splatData = itemPathWithAlias;
|
196
197
|
if (await hasAction(itemPath)) {
|
197
|
-
splatAction =
|
198
|
+
splatAction = itemPathWithAlias;
|
198
199
|
}
|
199
200
|
}
|
200
201
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
|
201
202
|
var _route_children2;
|
202
203
|
splatRoute = createRoute({
|
203
|
-
_component:
|
204
|
+
_component: itemPathWithAlias,
|
204
205
|
path: "*"
|
205
206
|
}, rootDir, itemPath, entryName, isMainEntry);
|
206
207
|
if (splatLoaderFile) {
|
@@ -221,10 +222,10 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
221
222
|
(_route_children2 = route.children) === null || _route_children2 === void 0 ? void 0 : _route_children2.push(splatRoute);
|
222
223
|
}
|
223
224
|
if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
|
224
|
-
route.loading =
|
225
|
+
route.loading = itemPathWithAlias;
|
225
226
|
}
|
226
227
|
if (itemWithoutExt === NESTED_ROUTE.ERROR_FILE) {
|
227
|
-
route.error =
|
228
|
+
route.error = itemPathWithAlias;
|
228
229
|
}
|
229
230
|
}
|
230
231
|
let finalRoute = createRoute(route, rootDir, path.join(dirname, `${NESTED_ROUTE.LAYOUT_FILE}.ts`), entryName, isMainEntry);
|
@@ -12,9 +12,10 @@ function initHtmlConfig(config, appContext) {
|
|
12
12
|
config.html.favicon = createBuilderFavicon(config, appContext);
|
13
13
|
return config.html;
|
14
14
|
function createBuilderAppIcon(config2, appContext2) {
|
15
|
+
const { appIcon } = config2.html;
|
15
16
|
const { configDir } = config2.source;
|
16
|
-
const
|
17
|
-
return
|
17
|
+
const defaultAppIcon = findExists(ICON_EXTENSIONS.map((ext) => path.resolve(appContext2.appDirectory, configDir || "./config", `icon.${ext}`)));
|
18
|
+
return appIcon || defaultAppIcon || void 0;
|
18
19
|
}
|
19
20
|
function createBuilderFavicon(config2, appContext2) {
|
20
21
|
const { configDir } = config2.source;
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.42.
|
18
|
+
"version": "2.42.2",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -72,24 +72,24 @@
|
|
72
72
|
"es-module-lexer": "^1.1.0",
|
73
73
|
"esbuild": "0.17.19",
|
74
74
|
"@swc/helpers": "0.5.3",
|
75
|
-
"@modern-js/builder": "2.42.
|
76
|
-
"@modern-js/builder-plugin-
|
77
|
-
"@modern-js/builder-
|
78
|
-
"@modern-js/builder-
|
79
|
-
"@modern-js/
|
80
|
-
"@modern-js/
|
81
|
-
"@modern-js/
|
82
|
-
"@modern-js/
|
83
|
-
"@modern-js/plugin": "2.42.
|
84
|
-
"@modern-js/
|
85
|
-
"@modern-js/plugin-i18n": "2.42.
|
86
|
-
"@modern-js/plugin-lint": "2.42.
|
87
|
-
"@modern-js/
|
88
|
-
"@modern-js/server": "2.42.
|
89
|
-
"@modern-js/
|
90
|
-
"@modern-js/
|
91
|
-
"@modern-js/utils": "2.42.
|
92
|
-
"@modern-js/server-core": "2.42.
|
75
|
+
"@modern-js/builder": "2.42.2",
|
76
|
+
"@modern-js/builder-plugin-node-polyfill": "2.42.2",
|
77
|
+
"@modern-js/builder-plugin-esbuild": "2.42.2",
|
78
|
+
"@modern-js/builder-webpack-provider": "2.42.2",
|
79
|
+
"@modern-js/core": "2.42.2",
|
80
|
+
"@modern-js/builder-shared": "2.42.2",
|
81
|
+
"@modern-js/new-action": "2.42.2",
|
82
|
+
"@modern-js/plugin": "2.42.2",
|
83
|
+
"@modern-js/plugin-data-loader": "2.42.2",
|
84
|
+
"@modern-js/node-bundle-require": "2.42.2",
|
85
|
+
"@modern-js/plugin-i18n": "2.42.2",
|
86
|
+
"@modern-js/plugin-lint": "2.42.2",
|
87
|
+
"@modern-js/types": "2.42.2",
|
88
|
+
"@modern-js/prod-server": "2.42.2",
|
89
|
+
"@modern-js/upgrade": "2.42.2",
|
90
|
+
"@modern-js/server": "2.42.2",
|
91
|
+
"@modern-js/utils": "2.42.2",
|
92
|
+
"@modern-js/server-core": "2.42.2"
|
93
93
|
},
|
94
94
|
"devDependencies": {
|
95
95
|
"@types/babel__traverse": "7.18.5",
|
@@ -98,13 +98,13 @@
|
|
98
98
|
"jest": "^29",
|
99
99
|
"typescript": "^5",
|
100
100
|
"webpack": "^5.88.1",
|
101
|
-
"@
|
102
|
-
"@modern-js/builder-
|
103
|
-
"@
|
104
|
-
"@scripts/jest-config": "2.42.
|
101
|
+
"@modern-js/builder-plugin-swc": "2.42.2",
|
102
|
+
"@modern-js/builder-rspack-provider": "2.42.2",
|
103
|
+
"@scripts/build": "2.42.2",
|
104
|
+
"@scripts/jest-config": "2.42.2"
|
105
105
|
},
|
106
106
|
"peerDependencies": {
|
107
|
-
"@modern-js/builder-rspack-provider": "^2.42.
|
107
|
+
"@modern-js/builder-rspack-provider": "^2.42.2"
|
108
108
|
},
|
109
109
|
"peerDependenciesMeta": {
|
110
110
|
"@modern-js/builder-rspack-provider": {
|