@modern-js/app-tools 2.2.1-alpha.0 → 2.3.1-alpha.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.
- package/CHANGELOG.md +42 -0
- package/dist/js/modern/analyze/constants.js +2 -1
- package/dist/js/modern/analyze/nestedRoutes.js +19 -2
- package/dist/js/modern/analyze/templates.js +2 -9
- package/dist/js/node/analyze/constants.js +2 -1
- package/dist/js/node/analyze/nestedRoutes.js +19 -2
- package/dist/js/node/analyze/templates.js +2 -9
- package/dist/js/treeshaking/analyze/constants.js +2 -1
- package/dist/js/treeshaking/analyze/nestedRoutes.js +18 -1
- package/dist/js/treeshaking/analyze/templates.js +3 -7
- package/dist/types/analyze/constants.d.ts +1 -0
- package/dist/types/defineConfig.d.ts +3 -2
- package/package.json +22 -22
- package/dist/js/modern/builder/loaders/routerLoader.js +0 -17
- package/dist/js/node/builder/loaders/routerLoader.js +0 -38
- package/dist/js/treeshaking/builder/loaders/routerLoader.js +0 -13
- package/dist/types/builder/loaders/routerLoader.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @modern-js/app-tools
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fd5a3ed: fix: failed to exit new command
|
|
8
|
+
|
|
9
|
+
fix: 修复 new 命令执行完成后未退出进程的问题
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [65f1322]
|
|
12
|
+
- Updated dependencies [7cd8185]
|
|
13
|
+
- Updated dependencies [fd5a3ed]
|
|
14
|
+
- Updated dependencies [362c9a8]
|
|
15
|
+
- Updated dependencies [67ba34a]
|
|
16
|
+
- Updated dependencies [2ad9fdf]
|
|
17
|
+
- Updated dependencies [7b2cdcb]
|
|
18
|
+
- Updated dependencies [1b0dd35]
|
|
19
|
+
- Updated dependencies [f9a26fe]
|
|
20
|
+
- Updated dependencies [6ca1c0b]
|
|
21
|
+
- Updated dependencies [89b6739]
|
|
22
|
+
- Updated dependencies [01e4a27]
|
|
23
|
+
- Updated dependencies [7736171]
|
|
24
|
+
- Updated dependencies [ff48fc2]
|
|
25
|
+
- Updated dependencies [b6c2eb8]
|
|
26
|
+
- Updated dependencies [3cdf48e]
|
|
27
|
+
- @modern-js/core@2.3.0
|
|
28
|
+
- @modern-js/builder@2.3.0
|
|
29
|
+
- @modern-js/builder-webpack-provider@2.3.0
|
|
30
|
+
- @modern-js/utils@2.3.0
|
|
31
|
+
- @modern-js/builder-shared@2.3.0
|
|
32
|
+
- @modern-js/server@2.3.0
|
|
33
|
+
- @modern-js/plugin-data-loader@2.3.0
|
|
34
|
+
- @modern-js/plugin-lint@2.3.0
|
|
35
|
+
- @modern-js/builder-plugin-esbuild@2.3.0
|
|
36
|
+
- @modern-js/builder-plugin-node-polyfill@2.3.0
|
|
37
|
+
- @modern-js/plugin-i18n@2.3.0
|
|
38
|
+
- @modern-js/new-action@2.3.0
|
|
39
|
+
- @modern-js/prod-server@2.3.0
|
|
40
|
+
- @modern-js/node-bundle-require@2.3.0
|
|
41
|
+
- @modern-js/upgrade@2.3.0
|
|
42
|
+
- @modern-js/plugin@2.3.0
|
|
43
|
+
- @modern-js/types@2.3.0
|
|
44
|
+
|
|
3
45
|
## 2.2.0
|
|
4
46
|
|
|
5
47
|
### Minor Changes
|
|
@@ -90,6 +90,8 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
90
90
|
};
|
|
91
91
|
let pageLoaderFile = "";
|
|
92
92
|
let pageRoute = null;
|
|
93
|
+
let splatLoaderFile = "";
|
|
94
|
+
let splatRoute = null;
|
|
93
95
|
const items = yield fs.readdir(dirname);
|
|
94
96
|
for (const item of items) {
|
|
95
97
|
const itemPath = path.join(dirname, item);
|
|
@@ -130,8 +132,11 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
130
132
|
}
|
|
131
133
|
(_b = route.children) == null ? void 0 : _b.push(pageRoute);
|
|
132
134
|
}
|
|
135
|
+
if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
|
136
|
+
splatLoaderFile = itemPath;
|
|
137
|
+
}
|
|
133
138
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
|
|
134
|
-
|
|
139
|
+
splatRoute = createRoute(
|
|
135
140
|
{
|
|
136
141
|
_component: replaceWithAlias(alias.basename, itemPath, alias.name),
|
|
137
142
|
path: "*"
|
|
@@ -140,6 +145,9 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
140
145
|
itemPath,
|
|
141
146
|
entryName
|
|
142
147
|
);
|
|
148
|
+
if (splatLoaderFile) {
|
|
149
|
+
splatRoute.loader = splatLoaderFile;
|
|
150
|
+
}
|
|
143
151
|
(_c = route.children) == null ? void 0 : _c.push(splatRoute);
|
|
144
152
|
}
|
|
145
153
|
if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
|
|
@@ -149,7 +157,7 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
149
157
|
route.error = replaceWithAlias(alias.basename, itemPath, alias.name);
|
|
150
158
|
}
|
|
151
159
|
}
|
|
152
|
-
|
|
160
|
+
let finalRoute = createRoute(
|
|
153
161
|
route,
|
|
154
162
|
rootDir,
|
|
155
163
|
path.join(dirname, `${NESTED_ROUTE.LAYOUT_FILE}.ts`),
|
|
@@ -162,6 +170,15 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
162
170
|
if (route.children && route.children.length === 0 && !route.index) {
|
|
163
171
|
return null;
|
|
164
172
|
}
|
|
173
|
+
if (finalRoute.children && finalRoute.children.length === 1 && !finalRoute._component) {
|
|
174
|
+
const childRoute = finalRoute.children[0];
|
|
175
|
+
if (childRoute.path === "*") {
|
|
176
|
+
const path2 = (finalRoute.path || "") + (childRoute.path || "");
|
|
177
|
+
finalRoute = __spreadProps(__spreadValues({}, childRoute), {
|
|
178
|
+
path: path2
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
165
182
|
return finalRoute;
|
|
166
183
|
});
|
|
167
184
|
export {
|
|
@@ -198,7 +198,6 @@ const fileSystemRoutes = (_0) => __async(void 0, [_0], function* ({
|
|
|
198
198
|
import loadable, { lazy as loadableLazy } from "@modern-js/runtime/loadable"
|
|
199
199
|
`;
|
|
200
200
|
let rootLayoutCode = ``;
|
|
201
|
-
let componentLoaderPath = "";
|
|
202
201
|
const getDataLoaderPath = (loaderId) => {
|
|
203
202
|
if (!ssrMode) {
|
|
204
203
|
return "";
|
|
@@ -211,12 +210,6 @@ const fileSystemRoutes = (_0) => __async(void 0, [_0], function* ({
|
|
|
211
210
|
}
|
|
212
211
|
return dataLoaderPath;
|
|
213
212
|
};
|
|
214
|
-
if (ssrMode) {
|
|
215
|
-
componentLoaderPath = `${path.join(
|
|
216
|
-
__dirname,
|
|
217
|
-
"../builder/loaders/routerLoader"
|
|
218
|
-
)}!`;
|
|
219
|
-
}
|
|
220
213
|
const traverseRouteTree = (route) => {
|
|
221
214
|
var _a;
|
|
222
215
|
let children;
|
|
@@ -252,10 +245,10 @@ const fileSystemRoutes = (_0) => __async(void 0, [_0], function* ({
|
|
|
252
245
|
rootLayoutCode = `import RootLayout from '${route._component}'`;
|
|
253
246
|
component = `RootLayout`;
|
|
254
247
|
} else if (ssrMode === "string") {
|
|
255
|
-
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${
|
|
248
|
+
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${route._component}')`;
|
|
256
249
|
component = `loadable(${lazyImport})`;
|
|
257
250
|
} else {
|
|
258
|
-
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${
|
|
251
|
+
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${route._component}')`;
|
|
259
252
|
component = `lazy(${lazyImport})`;
|
|
260
253
|
}
|
|
261
254
|
}
|
|
@@ -116,6 +116,8 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
116
116
|
};
|
|
117
117
|
let pageLoaderFile = "";
|
|
118
118
|
let pageRoute = null;
|
|
119
|
+
let splatLoaderFile = "";
|
|
120
|
+
let splatRoute = null;
|
|
119
121
|
const items = yield import_utils.fs.readdir(dirname);
|
|
120
122
|
for (const item of items) {
|
|
121
123
|
const itemPath = path.join(dirname, item);
|
|
@@ -156,8 +158,11 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
156
158
|
}
|
|
157
159
|
(_b = route.children) == null ? void 0 : _b.push(pageRoute);
|
|
158
160
|
}
|
|
161
|
+
if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
|
162
|
+
splatLoaderFile = itemPath;
|
|
163
|
+
}
|
|
159
164
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.SPLATE_FILE) {
|
|
160
|
-
|
|
165
|
+
splatRoute = createRoute(
|
|
161
166
|
{
|
|
162
167
|
_component: (0, import_utils2.replaceWithAlias)(alias.basename, itemPath, alias.name),
|
|
163
168
|
path: "*"
|
|
@@ -166,6 +171,9 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
166
171
|
itemPath,
|
|
167
172
|
entryName
|
|
168
173
|
);
|
|
174
|
+
if (splatLoaderFile) {
|
|
175
|
+
splatRoute.loader = splatLoaderFile;
|
|
176
|
+
}
|
|
169
177
|
(_c = route.children) == null ? void 0 : _c.push(splatRoute);
|
|
170
178
|
}
|
|
171
179
|
if (itemWithoutExt === import_constants.NESTED_ROUTE.LOADING_FILE) {
|
|
@@ -175,7 +183,7 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
175
183
|
route.error = (0, import_utils2.replaceWithAlias)(alias.basename, itemPath, alias.name);
|
|
176
184
|
}
|
|
177
185
|
}
|
|
178
|
-
|
|
186
|
+
let finalRoute = createRoute(
|
|
179
187
|
route,
|
|
180
188
|
rootDir,
|
|
181
189
|
path.join(dirname, `${import_constants.NESTED_ROUTE.LAYOUT_FILE}.ts`),
|
|
@@ -188,6 +196,15 @@ const walk = (dirname, rootDir, alias, entryName) => __async(void 0, null, funct
|
|
|
188
196
|
if (route.children && route.children.length === 0 && !route.index) {
|
|
189
197
|
return null;
|
|
190
198
|
}
|
|
199
|
+
if (finalRoute.children && finalRoute.children.length === 1 && !finalRoute._component) {
|
|
200
|
+
const childRoute = finalRoute.children[0];
|
|
201
|
+
if (childRoute.path === "*") {
|
|
202
|
+
const path2 = (finalRoute.path || "") + (childRoute.path || "");
|
|
203
|
+
finalRoute = __spreadProps(__spreadValues({}, childRoute), {
|
|
204
|
+
path: path2
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
191
208
|
return finalRoute;
|
|
192
209
|
});
|
|
193
210
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -228,7 +228,6 @@ const fileSystemRoutes = (_0) => __async(void 0, [_0], function* ({
|
|
|
228
228
|
import loadable, { lazy as loadableLazy } from "@modern-js/runtime/loadable"
|
|
229
229
|
`;
|
|
230
230
|
let rootLayoutCode = ``;
|
|
231
|
-
let componentLoaderPath = "";
|
|
232
231
|
const getDataLoaderPath = (loaderId) => {
|
|
233
232
|
if (!ssrMode) {
|
|
234
233
|
return "";
|
|
@@ -241,12 +240,6 @@ const fileSystemRoutes = (_0) => __async(void 0, [_0], function* ({
|
|
|
241
240
|
}
|
|
242
241
|
return dataLoaderPath;
|
|
243
242
|
};
|
|
244
|
-
if (ssrMode) {
|
|
245
|
-
componentLoaderPath = `${import_path.default.join(
|
|
246
|
-
__dirname,
|
|
247
|
-
"../builder/loaders/routerLoader"
|
|
248
|
-
)}!`;
|
|
249
|
-
}
|
|
250
243
|
const traverseRouteTree = (route) => {
|
|
251
244
|
var _a;
|
|
252
245
|
let children;
|
|
@@ -282,10 +275,10 @@ const fileSystemRoutes = (_0) => __async(void 0, [_0], function* ({
|
|
|
282
275
|
rootLayoutCode = `import RootLayout from '${route._component}'`;
|
|
283
276
|
component = `RootLayout`;
|
|
284
277
|
} else if (ssrMode === "string") {
|
|
285
|
-
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${
|
|
278
|
+
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${route._component}')`;
|
|
286
279
|
component = `loadable(${lazyImport})`;
|
|
287
280
|
} else {
|
|
288
|
-
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${
|
|
281
|
+
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${route._component}')`;
|
|
289
282
|
component = `lazy(${lazyImport})`;
|
|
290
283
|
}
|
|
291
284
|
}
|
|
@@ -197,7 +197,7 @@ var createRoute = function(routeInfo, rootDir, filename, entryName) {
|
|
|
197
197
|
};
|
|
198
198
|
var walk = function() {
|
|
199
199
|
var _ref = _asyncToGenerator(function(dirname, rootDir, alias, entryName) {
|
|
200
|
-
var ref, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, extname, itemWithoutExt, isDirectory2, childRoute, ref1, ref2, ref3,
|
|
200
|
+
var ref, isDirectory, relativeDir, pathSegments, lastSegment, isRoot, isPathlessLayout, isWithoutLayoutPath, routePath, route, pageLoaderFile, pageRoute, splatLoaderFile, splatRoute, items, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, itemPath, extname, itemWithoutExt, isDirectory2, childRoute, ref1, ref2, ref3, err, finalRoute, childRoute1, path2;
|
|
201
201
|
return __generator(this, function(_state) {
|
|
202
202
|
switch(_state.label){
|
|
203
203
|
case 0:
|
|
@@ -242,6 +242,8 @@ var walk = function() {
|
|
|
242
242
|
};
|
|
243
243
|
pageLoaderFile = "";
|
|
244
244
|
pageRoute = null;
|
|
245
|
+
splatLoaderFile = "";
|
|
246
|
+
splatRoute = null;
|
|
245
247
|
return [
|
|
246
248
|
4,
|
|
247
249
|
fs.readdir(dirname)
|
|
@@ -317,12 +319,18 @@ var walk = function() {
|
|
|
317
319
|
}
|
|
318
320
|
(ref2 = route.children) === null || ref2 === void 0 ? void 0 : ref2.push(pageRoute);
|
|
319
321
|
}
|
|
322
|
+
if (itemWithoutExt === NESTED_ROUTE.SPLATE_LOADER_FILE) {
|
|
323
|
+
splatLoaderFile = itemPath;
|
|
324
|
+
}
|
|
320
325
|
if (itemWithoutExt === NESTED_ROUTE.SPLATE_FILE) {
|
|
321
326
|
;
|
|
322
327
|
splatRoute = createRoute({
|
|
323
328
|
_component: replaceWithAlias(alias.basename, itemPath, alias.name),
|
|
324
329
|
path: "*"
|
|
325
330
|
}, rootDir, itemPath, entryName);
|
|
331
|
+
if (splatLoaderFile) {
|
|
332
|
+
splatRoute.loader = splatLoaderFile;
|
|
333
|
+
}
|
|
326
334
|
(ref3 = route.children) === null || ref3 === void 0 ? void 0 : ref3.push(splatRoute);
|
|
327
335
|
}
|
|
328
336
|
if (itemWithoutExt === NESTED_ROUTE.LOADING_FILE) {
|
|
@@ -378,6 +386,15 @@ var walk = function() {
|
|
|
378
386
|
null
|
|
379
387
|
];
|
|
380
388
|
}
|
|
389
|
+
if (finalRoute.children && finalRoute.children.length === 1 && !finalRoute._component) {
|
|
390
|
+
childRoute1 = finalRoute.children[0];
|
|
391
|
+
if (childRoute1.path === "*") {
|
|
392
|
+
path2 = (finalRoute.path || "") + (childRoute1.path || "");
|
|
393
|
+
finalRoute = _objectSpreadProps(_objectSpread({}, childRoute1), {
|
|
394
|
+
path: path2
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
381
398
|
return [
|
|
382
399
|
2,
|
|
383
400
|
finalRoute
|
|
@@ -296,7 +296,7 @@ var routesForServer = function(param) {
|
|
|
296
296
|
};
|
|
297
297
|
var fileSystemRoutes = function() {
|
|
298
298
|
var _ref = _asyncToGenerator(function(param) {
|
|
299
|
-
var routes, ssrMode, nestedRoutesEntry, entryName, internalDirectory, loadings, errors, loaders, loadersMap, loadersMapFile, importLazyCode, rootLayoutCode,
|
|
299
|
+
var routes, ssrMode, nestedRoutesEntry, entryName, internalDirectory, loadings, errors, loaders, loadersMap, loadersMapFile, importLazyCode, rootLayoutCode, getDataLoaderPath, traverseRouteTree, routeComponentsCode, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, route, newRoute, component, finalRoute, importLoadingCode, importErrorComponentsCode, importLoadersCode, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value, key, loaderInfo;
|
|
300
300
|
return __generator(this, function(_state) {
|
|
301
301
|
switch(_state.label){
|
|
302
302
|
case 0:
|
|
@@ -308,7 +308,6 @@ var fileSystemRoutes = function() {
|
|
|
308
308
|
loadersMapFile = path.join(internalDirectory, entryName, TEMP_LOADERS_DIR, "map.json");
|
|
309
309
|
importLazyCode = '\n import { lazy } from "react";\n import loadable, { lazy as loadableLazy } from "@modern-js/runtime/loadable"\n ';
|
|
310
310
|
rootLayoutCode = "";
|
|
311
|
-
componentLoaderPath = "";
|
|
312
311
|
getDataLoaderPath = function(loaderId) {
|
|
313
312
|
if (!ssrMode) {
|
|
314
313
|
return "";
|
|
@@ -319,9 +318,6 @@ var fileSystemRoutes = function() {
|
|
|
319
318
|
}
|
|
320
319
|
return dataLoaderPath;
|
|
321
320
|
};
|
|
322
|
-
if (ssrMode) {
|
|
323
|
-
componentLoaderPath = "".concat(path.join(__dirname, "../builder/loaders/routerLoader"), "!");
|
|
324
|
-
}
|
|
325
321
|
traverseRouteTree = function(route) {
|
|
326
322
|
var children;
|
|
327
323
|
if ("children" in route && route.children) {
|
|
@@ -357,10 +353,10 @@ var fileSystemRoutes = function() {
|
|
|
357
353
|
rootLayoutCode = "import RootLayout from '".concat(route._component, "'");
|
|
358
354
|
component = "RootLayout";
|
|
359
355
|
} else if (ssrMode === "string") {
|
|
360
|
-
lazyImport = '() => import(/* webpackChunkName: "'.concat(route.id, "\" */ '").concat(
|
|
356
|
+
lazyImport = '() => import(/* webpackChunkName: "'.concat(route.id, "\" */ '").concat(route._component, "')");
|
|
361
357
|
component = "loadable(".concat(lazyImport, ")");
|
|
362
358
|
} else {
|
|
363
|
-
lazyImport = '() => import(/* webpackChunkName: "'.concat(route.id, "\" */ '").concat(
|
|
359
|
+
lazyImport = '() => import(/* webpackChunkName: "'.concat(route.id, "\" */ '").concat(route._component, "')");
|
|
364
360
|
component = "lazy(".concat(lazyImport, ")");
|
|
365
361
|
}
|
|
366
362
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { UserConfigExport } from '@modern-js/core';
|
|
2
|
+
import type { AppUserConfig, AppLegacyUserConfig } from './types';
|
|
3
|
+
export declare const defineConfig: (config: UserConfigExport<AppUserConfig>) => UserConfigExport<AppUserConfig>;
|
|
3
4
|
/**
|
|
4
5
|
* @deprecated
|
|
5
6
|
* Using defineConfig first.
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.3.1-alpha.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -63,31 +63,31 @@
|
|
|
63
63
|
"@babel/runtime": "^7.18.0",
|
|
64
64
|
"@babel/traverse": "^7.18.0",
|
|
65
65
|
"@babel/types": "^7.18.0",
|
|
66
|
-
"@modern-js/builder": "2.
|
|
67
|
-
"@modern-js/builder-plugin-esbuild": "2.
|
|
68
|
-
"@modern-js/builder-plugin-node-polyfill": "2.
|
|
69
|
-
"@modern-js/builder-shared": "2.
|
|
70
|
-
"@modern-js/builder-webpack-provider": "2.
|
|
71
|
-
"@modern-js/core": "2.
|
|
72
|
-
"@modern-js/new-action": "2.
|
|
73
|
-
"@modern-js/node-bundle-require": "2.
|
|
74
|
-
"@modern-js/plugin": "2.
|
|
75
|
-
"@modern-js/plugin-data-loader": "2.
|
|
76
|
-
"@modern-js/plugin-i18n": "2.
|
|
77
|
-
"@modern-js/plugin-lint": "2.
|
|
78
|
-
"@modern-js/prod-server": "2.
|
|
79
|
-
"@modern-js/server": "2.
|
|
80
|
-
"@modern-js/types": "2.
|
|
81
|
-
"@modern-js/upgrade": "2.
|
|
82
|
-
"@modern-js/utils": "2.
|
|
66
|
+
"@modern-js/builder": "2.3.0",
|
|
67
|
+
"@modern-js/builder-plugin-esbuild": "2.3.0",
|
|
68
|
+
"@modern-js/builder-plugin-node-polyfill": "2.3.0",
|
|
69
|
+
"@modern-js/builder-shared": "2.3.0",
|
|
70
|
+
"@modern-js/builder-webpack-provider": "2.3.0",
|
|
71
|
+
"@modern-js/core": "2.3.0",
|
|
72
|
+
"@modern-js/new-action": "2.3.0",
|
|
73
|
+
"@modern-js/node-bundle-require": "2.3.0",
|
|
74
|
+
"@modern-js/plugin": "2.3.0",
|
|
75
|
+
"@modern-js/plugin-data-loader": "2.3.0",
|
|
76
|
+
"@modern-js/plugin-i18n": "2.3.0",
|
|
77
|
+
"@modern-js/plugin-lint": "2.3.0",
|
|
78
|
+
"@modern-js/prod-server": "2.3.0",
|
|
79
|
+
"@modern-js/server": "2.3.0",
|
|
80
|
+
"@modern-js/types": "2.3.0",
|
|
81
|
+
"@modern-js/upgrade": "2.3.0",
|
|
82
|
+
"@modern-js/utils": "2.3.0",
|
|
83
83
|
"es-module-lexer": "^1.1.0",
|
|
84
84
|
"esbuild": "0.15.7"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@modern-js/builder-plugin-swc": "2.
|
|
88
|
-
"@modern-js/server-core": "2.
|
|
89
|
-
"@scripts/build": "2.
|
|
90
|
-
"@scripts/jest-config": "2.
|
|
87
|
+
"@modern-js/builder-plugin-swc": "2.3.0",
|
|
88
|
+
"@modern-js/server-core": "2.3.0",
|
|
89
|
+
"@scripts/build": "2.3.0",
|
|
90
|
+
"@scripts/jest-config": "2.3.0",
|
|
91
91
|
"@types/babel__traverse": "^7.14.2",
|
|
92
92
|
"@types/jest": "^27",
|
|
93
93
|
"@types/node": "^14",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { slash } from "@modern-js/utils";
|
|
2
|
-
function loader(source) {
|
|
3
|
-
this.cacheable();
|
|
4
|
-
const { target } = this._compiler.options;
|
|
5
|
-
if (target === "node" || Array.isArray(target) && target.includes("node")) {
|
|
6
|
-
return source;
|
|
7
|
-
}
|
|
8
|
-
const { resourcePath } = this;
|
|
9
|
-
const code = `
|
|
10
|
-
export { default } from "${slash(resourcePath)}";
|
|
11
|
-
`;
|
|
12
|
-
return code;
|
|
13
|
-
}
|
|
14
|
-
var routerLoader_default = loader;
|
|
15
|
-
export {
|
|
16
|
-
routerLoader_default as default
|
|
17
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var routerLoader_exports = {};
|
|
19
|
-
__export(routerLoader_exports, {
|
|
20
|
-
default: () => routerLoader_default
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(routerLoader_exports);
|
|
23
|
-
var import_utils = require("@modern-js/utils");
|
|
24
|
-
function loader(source) {
|
|
25
|
-
this.cacheable();
|
|
26
|
-
const { target } = this._compiler.options;
|
|
27
|
-
if (target === "node" || Array.isArray(target) && target.includes("node")) {
|
|
28
|
-
return source;
|
|
29
|
-
}
|
|
30
|
-
const { resourcePath } = this;
|
|
31
|
-
const code = `
|
|
32
|
-
export { default } from "${(0, import_utils.slash)(resourcePath)}";
|
|
33
|
-
`;
|
|
34
|
-
return code;
|
|
35
|
-
}
|
|
36
|
-
var routerLoader_default = loader;
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { slash } from "@modern-js/utils";
|
|
2
|
-
function loader(source) {
|
|
3
|
-
this.cacheable();
|
|
4
|
-
var target = this._compiler.options.target;
|
|
5
|
-
if (target === "node" || Array.isArray(target) && target.includes("node")) {
|
|
6
|
-
return source;
|
|
7
|
-
}
|
|
8
|
-
var resourcePath = this.resourcePath;
|
|
9
|
-
var code = '\n export { default } from "'.concat(slash(resourcePath), '";\n ');
|
|
10
|
-
return code;
|
|
11
|
-
}
|
|
12
|
-
var routerLoader_default = loader;
|
|
13
|
-
export { routerLoader_default as default };
|