@modern-js/bff-core 2.7.1-alpha.4 → 2.7.1-alpha.5
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/router/utils.js +18 -17
- package/dist/esm/router/utils.js +18 -17
- package/package.json +1 -1
package/dist/cjs/router/utils.js
CHANGED
|
@@ -75,25 +75,26 @@ const enableRegister = (requireFn) => {
|
|
|
75
75
|
existTsLoader = Boolean(require.extensions[".ts"]);
|
|
76
76
|
firstCall = false;
|
|
77
77
|
}
|
|
78
|
-
if (!existTsLoader
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const tsConfigPaths = require("tsconfig-paths");
|
|
88
|
-
const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
|
|
89
|
-
if (loaderRes.resultType === "success") {
|
|
90
|
-
tsConfigPaths.register({
|
|
91
|
-
baseUrl: loaderRes.absoluteBaseUrl,
|
|
92
|
-
paths: loaderRes.paths
|
|
78
|
+
if (!existTsLoader) {
|
|
79
|
+
try {
|
|
80
|
+
const projectSearchDir = import_path.default.dirname(modulePath);
|
|
81
|
+
const tsNode = require("ts-node");
|
|
82
|
+
tsNode.register({
|
|
83
|
+
projectSearchDir,
|
|
84
|
+
scope: true,
|
|
85
|
+
transpileOnly: true,
|
|
86
|
+
ignore: ["(?:^|/)node_modules/"]
|
|
93
87
|
});
|
|
88
|
+
const tsConfigPaths = require("tsconfig-paths");
|
|
89
|
+
const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
|
|
90
|
+
if (loaderRes.resultType === "success") {
|
|
91
|
+
tsConfigPaths.register({
|
|
92
|
+
baseUrl: loaderRes.absoluteBaseUrl,
|
|
93
|
+
paths: loaderRes.paths
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
} catch (e) {
|
|
94
97
|
}
|
|
95
|
-
const requiredModule2 = requireFn(modulePath);
|
|
96
|
-
return requiredModule2;
|
|
97
98
|
}
|
|
98
99
|
const requiredModule = requireFn(modulePath);
|
|
99
100
|
return requiredModule;
|
package/dist/esm/router/utils.js
CHANGED
|
@@ -39,25 +39,26 @@ const enableRegister = (requireFn) => {
|
|
|
39
39
|
existTsLoader = Boolean(require.extensions[".ts"]);
|
|
40
40
|
firstCall = false;
|
|
41
41
|
}
|
|
42
|
-
if (!existTsLoader
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const tsConfigPaths = require("tsconfig-paths");
|
|
52
|
-
const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
|
|
53
|
-
if (loaderRes.resultType === "success") {
|
|
54
|
-
tsConfigPaths.register({
|
|
55
|
-
baseUrl: loaderRes.absoluteBaseUrl,
|
|
56
|
-
paths: loaderRes.paths
|
|
42
|
+
if (!existTsLoader) {
|
|
43
|
+
try {
|
|
44
|
+
const projectSearchDir = path.dirname(modulePath);
|
|
45
|
+
const tsNode = require("ts-node");
|
|
46
|
+
tsNode.register({
|
|
47
|
+
projectSearchDir,
|
|
48
|
+
scope: true,
|
|
49
|
+
transpileOnly: true,
|
|
50
|
+
ignore: ["(?:^|/)node_modules/"]
|
|
57
51
|
});
|
|
52
|
+
const tsConfigPaths = require("tsconfig-paths");
|
|
53
|
+
const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
|
|
54
|
+
if (loaderRes.resultType === "success") {
|
|
55
|
+
tsConfigPaths.register({
|
|
56
|
+
baseUrl: loaderRes.absoluteBaseUrl,
|
|
57
|
+
paths: loaderRes.paths
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
} catch (e) {
|
|
58
61
|
}
|
|
59
|
-
const requiredModule2 = requireFn(modulePath);
|
|
60
|
-
return requiredModule2;
|
|
61
62
|
}
|
|
62
63
|
const requiredModule = requireFn(modulePath);
|
|
63
64
|
return requiredModule;
|