@modern-js/app-tools 2.53.1-alpha.4 → 2.54.1-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/modern.js +0 -2
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +2 -1
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +2 -2
- package/dist/cjs/commands/build.js +2 -0
- package/dist/cjs/commands/deploy.js +2 -2
- package/dist/cjs/commands/dev.js +19 -5
- package/dist/cjs/commands/index.js +113 -7
- package/dist/cjs/commands/serve.js +19 -5
- package/dist/cjs/hooks.js +5 -0
- package/dist/cjs/index.js +14 -83
- package/dist/cjs/plugins/analyze/constants.js +56 -0
- package/dist/cjs/{analyze → plugins/analyze}/generateCode.js +11 -84
- package/dist/cjs/{analyze → plugins/analyze}/getBundleEntry.js +11 -20
- package/dist/cjs/{analyze → plugins/analyze}/getFileSystemEntry.js +33 -47
- package/dist/cjs/{analyze → plugins/analyze}/getServerRoutes.js +1 -1
- package/dist/cjs/{analyze → plugins/analyze}/index.js +9 -24
- package/dist/cjs/plugins/analyze/templates.js +101 -0
- package/dist/cjs/{analyze → plugins/analyze}/utils.js +12 -55
- package/dist/cjs/plugins/deploy/platforms/netlify.js +2 -2
- package/dist/cjs/plugins/deploy/platforms/node.js +2 -2
- package/dist/cjs/plugins/deploy/platforms/vercel.js +2 -2
- package/dist/cjs/{initialize → plugins/initialize}/index.js +1 -1
- package/dist/cjs/plugins/serverBuild.js +10 -4
- package/dist/cjs/utils/createServer.js +1 -1
- package/dist/cjs/utils/{getServerInternalPlugins.js → loadPlugins.js} +18 -11
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +4 -1
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +2 -2
- package/dist/esm/commands/build.js +16 -9
- package/dist/esm/commands/deploy.js +2 -2
- package/dist/esm/commands/dev.js +13 -9
- package/dist/esm/commands/index.js +411 -3
- package/dist/esm/commands/serve.js +12 -8
- package/dist/esm/hooks.js +5 -0
- package/dist/esm/index.js +12 -394
- package/dist/esm/plugins/analyze/constants.js +24 -0
- package/dist/esm/{analyze → plugins/analyze}/generateCode.js +27 -169
- package/dist/esm/plugins/analyze/getBundleEntry.js +101 -0
- package/dist/esm/plugins/analyze/getFileSystemEntry.js +195 -0
- package/dist/esm/{analyze → plugins/analyze}/getServerRoutes.js +1 -1
- package/dist/esm/{analyze → plugins/analyze}/index.js +42 -70
- package/dist/esm/plugins/analyze/templates.js +22 -0
- package/dist/esm/{analyze → plugins/analyze}/utils.js +13 -135
- package/dist/esm/plugins/deploy/platforms/netlify.js +5 -3
- package/dist/esm/plugins/deploy/platforms/node.js +5 -3
- package/dist/esm/plugins/deploy/platforms/vercel.js +5 -3
- package/dist/esm/{initialize → plugins/initialize}/index.js +1 -1
- package/dist/esm/plugins/serverBuild.js +13 -6
- package/dist/esm/utils/createServer.js +2 -2
- package/dist/esm/utils/loadPlugins.js +64 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.js +2 -1
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +2 -2
- package/dist/esm-node/commands/build.js +2 -0
- package/dist/esm-node/commands/deploy.js +2 -2
- package/dist/esm-node/commands/dev.js +11 -7
- package/dist/esm-node/commands/index.js +92 -3
- package/dist/esm-node/commands/serve.js +10 -6
- package/dist/esm-node/hooks.js +5 -0
- package/dist/esm-node/index.js +12 -79
- package/dist/esm-node/plugins/analyze/constants.js +24 -0
- package/dist/esm-node/{analyze → plugins/analyze}/generateCode.js +14 -87
- package/dist/esm-node/{analyze → plugins/analyze}/getBundleEntry.js +11 -20
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.js +75 -0
- package/dist/esm-node/{analyze → plugins/analyze}/getServerRoutes.js +1 -1
- package/dist/esm-node/{analyze → plugins/analyze}/index.js +10 -25
- package/dist/esm-node/plugins/analyze/templates.js +75 -0
- package/dist/esm-node/{analyze → plugins/analyze}/utils.js +13 -52
- package/dist/esm-node/plugins/deploy/platforms/netlify.js +3 -3
- package/dist/esm-node/plugins/deploy/platforms/node.js +3 -3
- package/dist/esm-node/plugins/deploy/platforms/vercel.js +3 -3
- package/dist/esm-node/{initialize → plugins/initialize}/index.js +1 -1
- package/dist/esm-node/plugins/serverBuild.js +11 -5
- package/dist/esm-node/utils/createServer.js +2 -2
- package/dist/esm-node/utils/loadPlugins.js +21 -0
- package/dist/types/builder/builder-webpack/createCopyPattern.d.ts +2 -2
- package/dist/types/commands/index.d.ts +10 -3
- package/dist/types/config/initialize/inits.d.ts +1 -1
- package/dist/types/exports/server.d.ts +4 -0
- package/dist/types/index.d.ts +2 -5
- package/dist/types/plugins/analyze/constants.d.ts +9 -0
- package/dist/types/{analyze → plugins/analyze}/generateCode.d.ts +1 -1
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +4 -0
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +5 -0
- package/dist/types/{analyze → plugins/analyze}/getHtmlTemplate.d.ts +1 -1
- package/dist/types/{analyze → plugins/analyze}/getServerRoutes.d.ts +1 -1
- package/dist/types/{analyze → plugins/analyze}/index.d.ts +1 -1
- package/dist/types/plugins/analyze/templates.d.ts +19 -0
- package/dist/types/{analyze → plugins/analyze}/utils.d.ts +4 -6
- package/dist/types/{initialize → plugins/initialize}/index.d.ts +1 -1
- package/dist/types/types/hooks.d.ts +11 -1
- package/dist/types/utils/loadPlugins.d.ts +5 -0
- package/package.json +22 -22
- package/dist/cjs/analyze/constants.js +0 -122
- package/dist/cjs/analyze/getClientRoutes/getRoutes.js +0 -197
- package/dist/cjs/analyze/getClientRoutes/getRoutesLegacy.js +0 -195
- package/dist/cjs/analyze/getClientRoutes/index.js +0 -31
- package/dist/cjs/analyze/getClientRoutes/utils.js +0 -59
- package/dist/cjs/analyze/makeLegalIdentifier.js +0 -37
- package/dist/cjs/analyze/nestedRoutes.js +0 -295
- package/dist/cjs/analyze/templates.js +0 -444
- package/dist/esm/analyze/constants.js +0 -76
- package/dist/esm/analyze/getBundleEntry.js +0 -75
- package/dist/esm/analyze/getClientRoutes/getRoutes.js +0 -185
- package/dist/esm/analyze/getClientRoutes/getRoutesLegacy.js +0 -183
- package/dist/esm/analyze/getClientRoutes/index.js +0 -6
- package/dist/esm/analyze/getClientRoutes/utils.js +0 -28
- package/dist/esm/analyze/getFileSystemEntry.js +0 -113
- package/dist/esm/analyze/makeLegalIdentifier.js +0 -15
- package/dist/esm/analyze/nestedRoutes.js +0 -398
- package/dist/esm/analyze/templates.js +0 -435
- package/dist/esm/utils/getServerInternalPlugins.js +0 -40
- package/dist/esm-node/analyze/constants.js +0 -76
- package/dist/esm-node/analyze/getClientRoutes/getRoutes.js +0 -163
- package/dist/esm-node/analyze/getClientRoutes/getRoutesLegacy.js +0 -161
- package/dist/esm-node/analyze/getClientRoutes/index.js +0 -6
- package/dist/esm-node/analyze/getClientRoutes/utils.js +0 -22
- package/dist/esm-node/analyze/getFileSystemEntry.js +0 -89
- package/dist/esm-node/analyze/makeLegalIdentifier.js +0 -13
- package/dist/esm-node/analyze/nestedRoutes.js +0 -259
- package/dist/esm-node/analyze/templates.js +0 -405
- package/dist/esm-node/utils/getServerInternalPlugins.js +0 -15
- package/dist/types/analyze/constants.d.ts +0 -42
- package/dist/types/analyze/getBundleEntry.d.ts +0 -3
- package/dist/types/analyze/getClientRoutes/getRoutes.d.ts +0 -8
- package/dist/types/analyze/getClientRoutes/getRoutesLegacy.d.ts +0 -9
- package/dist/types/analyze/getClientRoutes/index.d.ts +0 -2
- package/dist/types/analyze/getClientRoutes/utils.d.ts +0 -5
- package/dist/types/analyze/getFileSystemEntry.d.ts +0 -4
- package/dist/types/analyze/makeLegalIdentifier.d.ts +0 -1
- package/dist/types/analyze/nestedRoutes.d.ts +0 -7
- package/dist/types/analyze/templates.d.ts +0 -30
- package/dist/types/utils/getServerInternalPlugins.d.ts +0 -2
- /package/dist/cjs/{analyze → plugins/analyze}/getHtmlTemplate.js +0 -0
- /package/dist/cjs/{analyze → plugins/analyze}/isDefaultExportFunction.js +0 -0
- /package/dist/esm/{analyze → plugins/analyze}/getHtmlTemplate.js +0 -0
- /package/dist/esm/{analyze → plugins/analyze}/isDefaultExportFunction.js +0 -0
- /package/dist/esm-node/{analyze → plugins/analyze}/getHtmlTemplate.js +0 -0
- /package/dist/esm-node/{analyze → plugins/analyze}/isDefaultExportFunction.js +0 -0
- /package/dist/types/{analyze → plugins/analyze}/isDefaultExportFunction.d.ts +0 -0
@@ -37,8 +37,14 @@ var import_utils = require("@modern-js/utils");
|
|
37
37
|
var import_server_utils = require("@modern-js/server-utils");
|
38
38
|
const TS_CONFIG_FILENAME = "tsconfig.json";
|
39
39
|
function checkHasCache(appDir) {
|
40
|
-
const tsFilepath = import_path.default.resolve(appDir,
|
41
|
-
const jsfilepath = import_path.default.resolve(appDir,
|
40
|
+
const tsFilepath = import_path.default.resolve(appDir, import_utils.SERVER_DIR, "cache.ts");
|
41
|
+
const jsfilepath = import_path.default.resolve(appDir, import_utils.SERVER_DIR, "cache.js");
|
42
|
+
return import_fs.default.existsSync(tsFilepath) || import_fs.default.existsSync(jsfilepath);
|
43
|
+
}
|
44
|
+
function checkHasConfig(appDir, metaName = "modern-js") {
|
45
|
+
const meta = (0, import_utils.getMeta)(metaName);
|
46
|
+
const tsFilepath = import_path.default.resolve(appDir, import_utils.SERVER_DIR, `${meta}.server.ts`);
|
47
|
+
const jsfilepath = import_path.default.resolve(appDir, import_utils.SERVER_DIR, `${meta}.server.js`);
|
42
48
|
return import_fs.default.existsSync(tsFilepath) || import_fs.default.existsSync(jsfilepath);
|
43
49
|
}
|
44
50
|
var serverBuild_default = () => ({
|
@@ -46,8 +52,8 @@ var serverBuild_default = () => ({
|
|
46
52
|
setup(api) {
|
47
53
|
return {
|
48
54
|
async afterBuild() {
|
49
|
-
const { appDirectory, distDirectory } = api.useAppContext();
|
50
|
-
if (!checkHasCache(appDirectory)) {
|
55
|
+
const { appDirectory, distDirectory, metaName } = api.useAppContext();
|
56
|
+
if (!checkHasCache(appDirectory) && !checkHasConfig(appDirectory, metaName)) {
|
51
57
|
return;
|
52
58
|
}
|
53
59
|
const modernConfig = api.useResolvedConfigContext();
|
@@ -41,7 +41,7 @@ const createServer = async (options) => {
|
|
41
41
|
if (server) {
|
42
42
|
server.close();
|
43
43
|
}
|
44
|
-
server = await (0, import_server.createDevServer)(options, import_prod_server.
|
44
|
+
server = await (0, import_server.createDevServer)(options, import_prod_server.applyPlugins);
|
45
45
|
return server;
|
46
46
|
};
|
47
47
|
// Annotate the CommonJS export names for ESM import in node:
|
@@ -16,24 +16,31 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
return to;
|
17
17
|
};
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var
|
20
|
-
__export(
|
21
|
-
|
19
|
+
var loadPlugins_exports = {};
|
20
|
+
__export(loadPlugins_exports, {
|
21
|
+
getServerPlugins: () => getServerPlugins,
|
22
|
+
loadServerPlugins: () => loadServerPlugins
|
22
23
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
|
25
|
-
|
26
|
-
const
|
24
|
+
module.exports = __toCommonJS(loadPlugins_exports);
|
25
|
+
var import_prod_server = require("@modern-js/prod-server");
|
26
|
+
async function getServerPlugins(api) {
|
27
|
+
const runner = api.useHookRunners();
|
28
|
+
const { plugins } = await runner._internalServerPlugins({
|
27
29
|
plugins: []
|
28
30
|
});
|
29
|
-
const serverInternalPlugins = serverPlugins.reduce((result, plugin) => Object.assign(result, plugin), {});
|
30
31
|
api.setAppContext({
|
31
32
|
...api.useAppContext(),
|
32
|
-
|
33
|
+
serverPlugins: plugins
|
33
34
|
});
|
34
|
-
return
|
35
|
+
return plugins;
|
36
|
+
}
|
37
|
+
async function loadServerPlugins(api, appDirectory) {
|
38
|
+
const plugins = await getServerPlugins(api);
|
39
|
+
const instances = (0, import_prod_server.loadServerPlugins)(plugins, appDirectory);
|
40
|
+
return instances;
|
35
41
|
}
|
36
42
|
// Annotate the CommonJS export names for ESM import in node:
|
37
43
|
0 && (module.exports = {
|
38
|
-
|
44
|
+
getServerPlugins,
|
45
|
+
loadServerPlugins
|
39
46
|
});
|
@@ -2,10 +2,13 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
4
4
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
5
|
-
import { isHtmlDisabled
|
5
|
+
import { isHtmlDisabled } from "@rsbuild/shared";
|
6
6
|
import { MAIN_ENTRY_NAME, getEntryOptions, removeTailSlash } from "@modern-js/utils";
|
7
7
|
import { template as lodashTemplate } from "@modern-js/utils/lodash";
|
8
8
|
import { BottomTemplatePlugin } from "../bundlerPlugins";
|
9
|
+
var createVirtualModule = function(content) {
|
10
|
+
return "data:text/javascript,".concat(content);
|
11
|
+
};
|
9
12
|
var builderPluginAdapterHtml = function(options) {
|
10
13
|
return {
|
11
14
|
name: "builder-plugin-adapter-modern-html",
|
@@ -5,7 +5,7 @@ import { isHtmlDisabled } from "@rsbuild/shared";
|
|
5
5
|
import { mergeRsbuildConfig } from "@rsbuild/core";
|
6
6
|
import { fs, isUseSSRBundle } from "@modern-js/utils";
|
7
7
|
import { HtmlAsyncChunkPlugin, RouterPlugin } from "../bundlerPlugins";
|
8
|
-
import { getServerCombinedModueFile } from "../../../analyze/utils";
|
8
|
+
import { getServerCombinedModueFile } from "../../../plugins/analyze/utils";
|
9
9
|
var builderPluginAdapterSSR = function(options) {
|
10
10
|
return {
|
11
11
|
name: "builder-plugin-adapter-modern-ssr",
|
@@ -180,7 +180,7 @@ function applyFilterEntriesBySSRConfig(param) {
|
|
180
180
|
}
|
181
181
|
var _ref = serverConfig || {}, ssr = _ref.ssr, ssrByEntries = _ref.ssrByEntries;
|
182
182
|
entryNames.forEach(function(name) {
|
183
|
-
if (!ssgEntries.includes(name) && (ssr && (ssrByEntries === null || ssrByEntries === void 0 ? void 0 : ssrByEntries[name]) === false || !ssr && !(ssrByEntries === null || ssrByEntries === void 0 ? void 0 : ssrByEntries[name]))) {
|
183
|
+
if (!ssgEntries.includes(name) && !name.includes("server-loaders") && (ssr && (ssrByEntries === null || ssrByEntries === void 0 ? void 0 : ssrByEntries[name]) === false || !ssr && !(ssrByEntries === null || ssrByEntries === void 0 ? void 0 : ssrByEntries[name]))) {
|
184
184
|
chain.entryPoints.delete(name);
|
185
185
|
}
|
186
186
|
});
|
@@ -4,6 +4,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
5
5
|
import { ResolvedConfigContext } from "@modern-js/core";
|
6
6
|
import { logger } from "@modern-js/utils";
|
7
|
+
import { loadServerPlugins } from "../utils/loadPlugins";
|
7
8
|
import { generateRoutes } from "../utils/routes";
|
8
9
|
import { buildServerConfig } from "../utils/config";
|
9
10
|
import { registerCompiler } from "../utils/register";
|
@@ -21,15 +22,21 @@ var build = function() {
|
|
21
22
|
hookRunners = api.useHookRunners();
|
22
23
|
return [
|
23
24
|
4,
|
24
|
-
|
25
|
+
loadServerPlugins(api, appContext.appDirectory)
|
25
26
|
];
|
26
27
|
case 1:
|
28
|
+
_state.sent();
|
29
|
+
return [
|
30
|
+
4,
|
31
|
+
registerCompiler(appContext.appDirectory, appContext.distDirectory, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias)
|
32
|
+
];
|
33
|
+
case 2:
|
27
34
|
_state.sent();
|
28
35
|
apiOnly = appContext.apiOnly;
|
29
36
|
if (!apiOnly)
|
30
37
|
return [
|
31
38
|
3,
|
32
|
-
|
39
|
+
7
|
33
40
|
];
|
34
41
|
appDirectory = appContext.appDirectory, distDirectory = appContext.distDirectory, serverConfigFile = appContext.serverConfigFile;
|
35
42
|
return [
|
@@ -39,7 +46,7 @@ var build = function() {
|
|
39
46
|
bundlerConfigs: void 0
|
40
47
|
})
|
41
48
|
];
|
42
|
-
case
|
49
|
+
case 3:
|
43
50
|
_state.sent();
|
44
51
|
return [
|
45
52
|
4,
|
@@ -49,13 +56,13 @@ var build = function() {
|
|
49
56
|
configFile: serverConfigFile
|
50
57
|
})
|
51
58
|
];
|
52
|
-
case
|
59
|
+
case 4:
|
53
60
|
_state.sent();
|
54
61
|
return [
|
55
62
|
4,
|
56
63
|
generateRoutes(appContext)
|
57
64
|
];
|
58
|
-
case
|
65
|
+
case 5:
|
59
66
|
_state.sent();
|
60
67
|
return [
|
61
68
|
4,
|
@@ -64,12 +71,12 @@ var build = function() {
|
|
64
71
|
stats: void 0
|
65
72
|
})
|
66
73
|
];
|
67
|
-
case
|
74
|
+
case 6:
|
68
75
|
_state.sent();
|
69
76
|
return [
|
70
77
|
2
|
71
78
|
];
|
72
|
-
case
|
79
|
+
case 7:
|
73
80
|
resolvedConfig = _object_spread_props(_object_spread({}, resolvedConfig), {
|
74
81
|
cliOptions: options
|
75
82
|
});
|
@@ -83,7 +90,7 @@ var build = function() {
|
|
83
90
|
configFile: serverConfigFile1
|
84
91
|
})
|
85
92
|
];
|
86
|
-
case
|
93
|
+
case 8:
|
87
94
|
_state.sent();
|
88
95
|
logger.info("Starting production build...");
|
89
96
|
if (!appContext.builder) {
|
@@ -93,7 +100,7 @@ var build = function() {
|
|
93
100
|
4,
|
94
101
|
appContext.builder.build()
|
95
102
|
];
|
96
|
-
case
|
103
|
+
case 9:
|
97
104
|
_state.sent();
|
98
105
|
return [
|
99
106
|
2
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
2
2
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
3
|
-
import {
|
3
|
+
import { getServerPlugins } from "../utils/loadPlugins";
|
4
4
|
var deploy = function() {
|
5
5
|
var _ref = _async_to_generator(function(api, options) {
|
6
6
|
var hookRunners;
|
@@ -10,7 +10,7 @@ var deploy = function() {
|
|
10
10
|
hookRunners = api.useHookRunners();
|
11
11
|
return [
|
12
12
|
4,
|
13
|
-
|
13
|
+
getServerPlugins(api)
|
14
14
|
];
|
15
15
|
case 1:
|
16
16
|
_state.sent();
|
package/dist/esm/commands/dev.js
CHANGED
@@ -2,19 +2,20 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
4
4
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
5
|
+
import path from "node:path";
|
5
6
|
import { ResolvedConfigContext } from "@modern-js/core";
|
6
|
-
import { DEFAULT_DEV_HOST } from "@modern-js/utils";
|
7
|
+
import { DEFAULT_DEV_HOST, SERVER_DIR, getMeta } from "@modern-js/utils";
|
7
8
|
import { createDevServer } from "@modern-js/server";
|
8
|
-
import {
|
9
|
+
import { applyPlugins } from "@modern-js/prod-server";
|
10
|
+
import { loadServerPlugins } from "../utils/loadPlugins";
|
9
11
|
import { registerCompiler } from "../utils/register";
|
10
12
|
import { printInstructions } from "../utils/printInstructions";
|
11
13
|
import { setServer } from "../utils/createServer";
|
12
14
|
import { generateRoutes } from "../utils/routes";
|
13
15
|
import { buildServerConfig } from "../utils/config";
|
14
|
-
import { getServerInternalPlugins } from "../utils/getServerInternalPlugins";
|
15
16
|
var dev = function() {
|
16
17
|
var _ref = _async_to_generator(function(api, options) {
|
17
|
-
var devServerOptions, _normalizedConfig_source, _normalizedConfig_tools, normalizedConfig, appContext, hookRunners, appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes,
|
18
|
+
var devServerOptions, _normalizedConfig_source, _normalizedConfig_tools, normalizedConfig, appContext, hookRunners, appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes, meta, serverConfigPath, pluginInstances, serverOptions, _normalizedConfig_dev, app, host, server;
|
18
19
|
var _arguments = arguments;
|
19
20
|
return _ts_generator(this, function(_state) {
|
20
21
|
switch (_state.label) {
|
@@ -48,6 +49,8 @@ var dev = function() {
|
|
48
49
|
];
|
49
50
|
case 2:
|
50
51
|
_state.sent();
|
52
|
+
meta = getMeta(metaName);
|
53
|
+
serverConfigPath = path.resolve(appDirectory, SERVER_DIR, "".concat(meta, ".server"));
|
51
54
|
return [
|
52
55
|
4,
|
53
56
|
hookRunners.beforeDev()
|
@@ -65,10 +68,10 @@ var dev = function() {
|
|
65
68
|
_state.sent();
|
66
69
|
return [
|
67
70
|
4,
|
68
|
-
|
71
|
+
loadServerPlugins(api, appDirectory)
|
69
72
|
];
|
70
73
|
case 5:
|
71
|
-
|
74
|
+
pluginInstances = _state.sent();
|
72
75
|
serverOptions = _object_spread({
|
73
76
|
metaName,
|
74
77
|
dev: _object_spread({
|
@@ -82,11 +85,12 @@ var dev = function() {
|
|
82
85
|
lambdaDirectory: appContext.lambdaDirectory,
|
83
86
|
sharedDirectory: appContext.sharedDirectory
|
84
87
|
},
|
88
|
+
serverConfigPath,
|
85
89
|
routes: serverRoutes,
|
86
90
|
pwd: appDirectory,
|
87
91
|
config: normalizedConfig,
|
88
92
|
serverConfigFile,
|
89
|
-
|
93
|
+
plugins: pluginInstances
|
90
94
|
}, devServerOptions);
|
91
95
|
if (!apiOnly)
|
92
96
|
return [
|
@@ -95,7 +99,7 @@ var dev = function() {
|
|
95
99
|
];
|
96
100
|
return [
|
97
101
|
4,
|
98
|
-
createDevServer(serverOptions,
|
102
|
+
createDevServer(serverOptions, applyPlugins)
|
99
103
|
];
|
100
104
|
case 6:
|
101
105
|
app = _state.sent();
|
@@ -115,7 +119,7 @@ var dev = function() {
|
|
115
119
|
4,
|
116
120
|
appContext.builder.startDevServer({
|
117
121
|
serverOptions,
|
118
|
-
|
122
|
+
applyPlugins
|
119
123
|
})
|
120
124
|
];
|
121
125
|
case 8:
|