@modern-js/prod-server 2.68.5 → 2.68.7

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.
@@ -25,6 +25,7 @@ var import_server_core = require("@modern-js/server-core");
25
25
  var import_node = require("@modern-js/server-core/node");
26
26
  var import_apply = require("./apply");
27
27
  const createNetlifyFunction = async (options) => {
28
+ await (0, import_node.loadServerEnv)(options);
28
29
  const serverBaseOptions = options;
29
30
  const serverCliConfig = (0, import_node.loadServerCliConfig)(options.pwd, options.config);
30
31
  if (serverCliConfig) {
@@ -32,13 +33,13 @@ const createNetlifyFunction = async (options) => {
32
33
  }
33
34
  const serverRuntimeConfig = await (0, import_node.loadServerRuntimeConfig)(options.pwd, options.serverConfigFile, options.serverConfigPath, options.metaName);
34
35
  if (serverRuntimeConfig) {
36
+ serverBaseOptions.serverConfig = serverRuntimeConfig;
35
37
  serverBaseOptions.plugins = [
36
38
  ...serverRuntimeConfig.plugins || [],
37
39
  ...options.plugins || []
38
40
  ];
39
41
  }
40
42
  const server = (0, import_server_core.createServerBase)(serverBaseOptions);
41
- await (0, import_node.loadServerEnv)(options);
42
43
  await (0, import_apply.applyPlugins)(server, options);
43
44
  await server.init();
44
45
  return (request, context) => {
@@ -10,6 +10,12 @@ var createNetlifyFunction = function() {
10
10
  return _ts_generator(this, function(_state) {
11
11
  switch (_state.label) {
12
12
  case 0:
13
+ return [
14
+ 4,
15
+ loadServerEnv(options)
16
+ ];
17
+ case 1:
18
+ _state.sent();
13
19
  serverBaseOptions = options;
14
20
  serverCliConfig = loadServerCliConfig(options.pwd, options.config);
15
21
  if (serverCliConfig) {
@@ -19,18 +25,13 @@ var createNetlifyFunction = function() {
19
25
  4,
20
26
  loadServerRuntimeConfig(options.pwd, options.serverConfigFile, options.serverConfigPath, options.metaName)
21
27
  ];
22
- case 1:
28
+ case 2:
23
29
  serverRuntimeConfig = _state.sent();
24
30
  if (serverRuntimeConfig) {
31
+ serverBaseOptions.serverConfig = serverRuntimeConfig;
25
32
  serverBaseOptions.plugins = _to_consumable_array(serverRuntimeConfig.plugins || []).concat(_to_consumable_array(options.plugins || []));
26
33
  }
27
34
  server = createServerBase(serverBaseOptions);
28
- return [
29
- 4,
30
- loadServerEnv(options)
31
- ];
32
- case 2:
33
- _state.sent();
34
35
  return [
35
36
  4,
36
37
  applyPlugins(server, options)
@@ -2,6 +2,7 @@ import { createServerBase } from "@modern-js/server-core";
2
2
  import { loadServerCliConfig, loadServerEnv, loadServerRuntimeConfig } from "@modern-js/server-core/node";
3
3
  import { applyPlugins } from "./apply";
4
4
  const createNetlifyFunction = async (options) => {
5
+ await loadServerEnv(options);
5
6
  const serverBaseOptions = options;
6
7
  const serverCliConfig = loadServerCliConfig(options.pwd, options.config);
7
8
  if (serverCliConfig) {
@@ -9,13 +10,13 @@ const createNetlifyFunction = async (options) => {
9
10
  }
10
11
  const serverRuntimeConfig = await loadServerRuntimeConfig(options.pwd, options.serverConfigFile, options.serverConfigPath, options.metaName);
11
12
  if (serverRuntimeConfig) {
13
+ serverBaseOptions.serverConfig = serverRuntimeConfig;
12
14
  serverBaseOptions.plugins = [
13
15
  ...serverRuntimeConfig.plugins || [],
14
16
  ...options.plugins || []
15
17
  ];
16
18
  }
17
19
  const server = createServerBase(serverBaseOptions);
18
- await loadServerEnv(options);
19
20
  await applyPlugins(server, options);
20
21
  await server.init();
21
22
  return (request, context) => {
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.68.5",
18
+ "version": "2.68.7",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -41,9 +41,9 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@swc/helpers": "^0.5.17",
44
- "@modern-js/runtime-utils": "2.68.5",
45
- "@modern-js/server-core": "2.68.5",
46
- "@modern-js/utils": "2.68.5"
44
+ "@modern-js/server-core": "2.68.7",
45
+ "@modern-js/utils": "2.68.7",
46
+ "@modern-js/runtime-utils": "2.68.7"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/jest": "^29",
@@ -53,7 +53,7 @@
53
53
  "lint-staged": "~13.3.0",
54
54
  "tsx": "^3.12.7",
55
55
  "typescript": "~5.0.4",
56
- "@modern-js/types": "2.68.5",
56
+ "@modern-js/types": "2.68.7",
57
57
  "@scripts/build": "2.66.0",
58
58
  "@scripts/jest-config": "2.66.0"
59
59
  },