@modern-js/plugin-bff 1.1.2 → 1.1.3-beta.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/.runtime-exports/index.js +1 -1
- package/dist/js/modern/server.js +2 -1
- package/dist/js/node/server.js +2 -1
- package/package.json +1 -1
- package/src/server.ts +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '/
|
|
1
|
+
export * from '/Users/bytedance/Desktop/workspaces/modern.js/packages/cli/plugin-runtime'
|
package/dist/js/modern/server.js
CHANGED
|
@@ -31,11 +31,12 @@ export default createPlugin(() => {
|
|
|
31
31
|
const root = isProd() ? distDirectory : appDirectory;
|
|
32
32
|
const apiPath = path.resolve(root || process.cwd(), API_DIR);
|
|
33
33
|
const apiAppPath = path.resolve(apiPath, API_APP_NAME);
|
|
34
|
+
console.log('111111111111111', process.env.NODE_ENV, isProd(), appDirectory, distDirectory, apiPath, apiAppPath);
|
|
34
35
|
const storage = new Storage();
|
|
35
36
|
const transformAPI = createTransformAPI(storage);
|
|
36
37
|
const apiMod = requireExistModule(apiAppPath);
|
|
37
38
|
|
|
38
|
-
if (apiMod) {
|
|
39
|
+
if (apiMod && typeof apiMod === 'function') {
|
|
39
40
|
apiMod(transformAPI);
|
|
40
41
|
}
|
|
41
42
|
|
package/dist/js/node/server.js
CHANGED
|
@@ -48,11 +48,12 @@ var _default = (0, _serverPlugin.createPlugin)(() => {
|
|
|
48
48
|
|
|
49
49
|
const apiAppPath = _path.default.resolve(apiPath, _constants.API_APP_NAME);
|
|
50
50
|
|
|
51
|
+
console.log('111111111111111', process.env.NODE_ENV, (0, _utils.isProd)(), appDirectory, distDirectory, apiPath, apiAppPath);
|
|
51
52
|
const storage = new Storage();
|
|
52
53
|
const transformAPI = createTransformAPI(storage);
|
|
53
54
|
const apiMod = (0, _utils.requireExistModule)(apiAppPath);
|
|
54
55
|
|
|
55
|
-
if (apiMod) {
|
|
56
|
+
if (apiMod && typeof apiMod === 'function') {
|
|
56
57
|
apiMod(transformAPI);
|
|
57
58
|
}
|
|
58
59
|
|
package/package.json
CHANGED
package/src/server.ts
CHANGED
|
@@ -29,11 +29,21 @@ export default createPlugin(
|
|
|
29
29
|
const apiPath = path.resolve(root || process.cwd(), API_DIR);
|
|
30
30
|
const apiAppPath = path.resolve(apiPath, API_APP_NAME);
|
|
31
31
|
|
|
32
|
+
console.log(
|
|
33
|
+
'111111111111111',
|
|
34
|
+
process.env.NODE_ENV,
|
|
35
|
+
isProd(),
|
|
36
|
+
appDirectory,
|
|
37
|
+
distDirectory,
|
|
38
|
+
apiPath,
|
|
39
|
+
apiAppPath,
|
|
40
|
+
);
|
|
41
|
+
|
|
32
42
|
const storage = new Storage();
|
|
33
43
|
const transformAPI = createTransformAPI(storage);
|
|
34
44
|
|
|
35
45
|
const apiMod = requireExistModule(apiAppPath);
|
|
36
|
-
if (apiMod) {
|
|
46
|
+
if (apiMod && typeof apiMod === 'function') {
|
|
37
47
|
apiMod(transformAPI);
|
|
38
48
|
}
|
|
39
49
|
|