@modern-js/app-tools 2.0.0-beta.2 → 2.0.0-beta.4
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 +556 -0
- package/bin/modern.js +11 -1
- package/dist/js/modern/analyze/Builder.js +39 -0
- package/dist/js/modern/analyze/constants.js +38 -16
- package/dist/js/modern/analyze/generateCode.js +272 -211
- package/dist/js/modern/analyze/getBundleEntry.js +34 -32
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +93 -49
- package/dist/js/modern/analyze/getClientRoutes/getRoutesLegacy.js +89 -47
- package/dist/js/modern/analyze/getClientRoutes/index.js +6 -2
- package/dist/js/modern/analyze/getClientRoutes/utils.js +23 -10
- package/dist/js/modern/analyze/getFileSystemEntry.js +43 -22
- package/dist/js/modern/analyze/getHtmlTemplate.js +89 -49
- package/dist/js/modern/analyze/getServerRoutes.js +122 -126
- package/dist/js/modern/analyze/index.js +201 -160
- package/dist/js/modern/analyze/isDefaultExportFunction.js +30 -16
- package/dist/js/modern/analyze/makeLegalIdentifier.js +10 -11
- package/dist/js/modern/analyze/nestedRoutes.js +110 -53
- package/dist/js/modern/analyze/templates.js +191 -77
- package/dist/js/modern/analyze/utils.js +98 -51
- package/dist/js/modern/builder/builderPlugins/compatModern.js +125 -107
- package/dist/js/modern/builder/index.js +124 -89
- package/dist/js/modern/builder/loaders/routerLoader.js +17 -0
- package/dist/js/modern/builder/loaders/serverModuleLoader.js +7 -0
- package/dist/js/modern/builder/share.js +23 -21
- package/dist/js/modern/builder/webpackPlugins/htmlAsyncChunkPlugin.js +23 -22
- package/dist/js/modern/builder/webpackPlugins/htmlBottomTemplate.js +31 -27
- package/dist/js/modern/builder/webpackPlugins/routerPlugin.js +100 -84
- package/dist/js/modern/commands/build.js +67 -42
- package/dist/js/modern/commands/deploy.js +27 -4
- package/dist/js/modern/commands/dev.js +93 -47
- package/dist/js/modern/commands/index.js +1 -1
- package/dist/js/modern/commands/inspect.js +30 -5
- package/dist/js/modern/commands/start.js +37 -16
- package/dist/js/modern/config/default.js +103 -114
- package/dist/js/modern/config/index.js +8 -2
- package/dist/js/modern/config/initial/createHtmlConfig.js +5 -2
- package/dist/js/modern/config/initial/createOutputConfig.js +11 -9
- package/dist/js/modern/config/initial/createSourceConfig.js +5 -2
- package/dist/js/modern/config/initial/createToolsConfig.js +7 -6
- package/dist/js/modern/config/initial/index.js +9 -4
- package/dist/js/modern/config/initial/inits.js +109 -73
- package/dist/js/modern/config/initial/transformNormalizedConfig.js +6 -3
- package/dist/js/modern/defineConfig.js +26 -11
- package/dist/js/modern/exports/server.js +4 -1
- package/dist/js/modern/hooks.js +15 -4
- package/dist/js/modern/index.js +178 -90
- package/dist/js/modern/initialize/index.js +98 -51
- package/dist/js/modern/locale/en.js +20 -21
- package/dist/js/modern/locale/index.js +6 -6
- package/dist/js/modern/locale/zh.js +21 -22
- package/dist/js/modern/schema/Schema.js +6 -5
- package/dist/js/modern/schema/index.js +51 -100
- package/dist/js/modern/schema/legacy.js +96 -231
- package/dist/js/modern/types/config/index.js +0 -1
- package/dist/js/modern/types/index.js +0 -1
- package/dist/js/modern/types/legacyConfig/output.js +0 -1
- package/dist/js/modern/utils/commands.js +5 -2
- package/dist/js/modern/utils/config.js +102 -41
- package/dist/js/modern/utils/createFileWatcher.js +84 -51
- package/dist/js/modern/utils/createServer.js +63 -17
- package/dist/js/modern/utils/getSpecifiedEntries.js +46 -19
- package/dist/js/modern/utils/language.js +6 -3
- package/dist/js/modern/utils/printInstructions.js +27 -8
- package/dist/js/modern/utils/restart.js +43 -16
- package/dist/js/modern/utils/routes.js +29 -12
- package/dist/js/node/analyze/Builder.js +58 -0
- package/dist/js/node/analyze/constants.js +54 -35
- package/dist/js/node/analyze/generateCode.js +291 -228
- package/dist/js/node/analyze/getBundleEntry.js +58 -44
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +132 -76
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +128 -74
- package/dist/js/node/analyze/getClientRoutes/index.js +23 -17
- package/dist/js/node/analyze/getClientRoutes/utils.js +44 -21
- package/dist/js/node/analyze/getFileSystemEntry.js +70 -39
- package/dist/js/node/analyze/getHtmlTemplate.js +116 -61
- package/dist/js/node/analyze/getServerRoutes.js +143 -137
- package/dist/js/node/analyze/index.js +247 -174
- package/dist/js/node/analyze/isDefaultExportFunction.js +55 -26
- package/dist/js/node/analyze/makeLegalIdentifier.js +27 -15
- package/dist/js/node/analyze/nestedRoutes.js +140 -67
- package/dist/js/node/analyze/templates.js +212 -84
- package/dist/js/node/analyze/utils.js +123 -62
- package/dist/js/node/builder/builderPlugins/compatModern.js +153 -120
- package/dist/js/node/builder/index.js +152 -98
- package/dist/js/node/builder/loaders/routerLoader.js +36 -0
- package/dist/js/node/builder/loaders/serverModuleLoader.js +26 -0
- package/dist/js/node/builder/share.js +46 -26
- package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +39 -26
- package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +47 -31
- package/dist/js/node/builder/webpackPlugins/routerPlugin.js +118 -90
- package/dist/js/node/commands/build.js +89 -52
- package/dist/js/node/commands/deploy.js +45 -10
- package/dist/js/node/commands/dev.js +115 -61
- package/dist/js/node/commands/index.js +19 -38
- package/dist/js/node/commands/inspect.js +48 -11
- package/dist/js/node/commands/start.js +65 -27
- package/dist/js/node/config/default.js +119 -118
- package/dist/js/node/config/index.js +25 -29
- package/dist/js/node/config/initial/createHtmlConfig.js +22 -6
- package/dist/js/node/config/initial/createOutputConfig.js +28 -13
- package/dist/js/node/config/initial/createSourceConfig.js +22 -6
- package/dist/js/node/config/initial/createToolsConfig.js +24 -10
- package/dist/js/node/config/initial/index.js +28 -17
- package/dist/js/node/config/initial/inits.js +126 -81
- package/dist/js/node/config/initial/transformNormalizedConfig.js +31 -15
- package/dist/js/node/defineConfig.js +43 -17
- package/dist/js/node/exports/server.js +21 -10
- package/dist/js/node/hooks.js +48 -29
- package/dist/js/node/index.js +225 -128
- package/dist/js/node/initialize/index.js +116 -61
- package/dist/js/node/locale/en.js +36 -25
- package/dist/js/node/locale/index.js +27 -15
- package/dist/js/node/locale/zh.js +37 -26
- package/dist/js/node/schema/Schema.js +23 -10
- package/dist/js/node/schema/index.js +77 -114
- package/dist/js/node/schema/legacy.js +117 -240
- package/dist/js/node/types/config/index.js +17 -16
- package/dist/js/node/types/index.js +19 -38
- package/dist/js/node/types/legacyConfig/output.js +0 -5
- package/dist/js/node/utils/commands.js +21 -6
- package/dist/js/node/utils/config.js +120 -51
- package/dist/js/node/utils/createFileWatcher.js +104 -60
- package/dist/js/node/utils/createServer.js +86 -25
- package/dist/js/node/utils/getSpecifiedEntries.js +64 -25
- package/dist/js/node/utils/language.js +24 -8
- package/dist/js/node/utils/printInstructions.js +47 -16
- package/dist/js/node/utils/restart.js +61 -21
- package/dist/js/node/utils/routes.js +53 -18
- package/dist/js/treeshaking/analyze/Builder.js +199 -0
- package/dist/js/treeshaking/analyze/constants.js +28 -16
- package/dist/js/treeshaking/analyze/generateCode.js +605 -355
- package/dist/js/treeshaking/analyze/getBundleEntry.js +55 -63
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +214 -168
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutesLegacy.js +215 -169
- package/dist/js/treeshaking/analyze/getClientRoutes/index.js +3 -2
- package/dist/js/treeshaking/analyze/getClientRoutes/utils.js +19 -20
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +89 -86
- package/dist/js/treeshaking/analyze/getHtmlTemplate.js +298 -125
- package/dist/js/treeshaking/analyze/getServerRoutes.js +210 -146
- package/dist/js/treeshaking/analyze/index.js +571 -304
- package/dist/js/treeshaking/analyze/isDefaultExportFunction.js +45 -26
- package/dist/js/treeshaking/analyze/makeLegalIdentifier.js +13 -16
- package/dist/js/treeshaking/analyze/nestedRoutes.js +414 -160
- package/dist/js/treeshaking/analyze/templates.js +432 -161
- package/dist/js/treeshaking/analyze/utils.js +361 -80
- package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +282 -195
- package/dist/js/treeshaking/builder/index.js +371 -167
- package/dist/js/treeshaking/builder/loaders/routerLoader.js +13 -0
- package/dist/js/treeshaking/builder/loaders/serverModuleLoader.js +5 -0
- package/dist/js/treeshaking/builder/share.js +38 -44
- package/dist/js/treeshaking/builder/webpackPlugins/htmlAsyncChunkPlugin.js +108 -44
- package/dist/js/treeshaking/builder/webpackPlugins/htmlBottomTemplate.js +70 -39
- package/dist/js/treeshaking/builder/webpackPlugins/routerPlugin.js +334 -112
- package/dist/js/treeshaking/commands/build.js +286 -88
- package/dist/js/treeshaking/commands/deploy.js +153 -25
- package/dist/js/treeshaking/commands/dev.js +318 -132
- package/dist/js/treeshaking/commands/index.js +1 -1
- package/dist/js/treeshaking/commands/inspect.js +147 -32
- package/dist/js/treeshaking/commands/start.js +190 -68
- package/dist/js/treeshaking/config/default.js +210 -199
- package/dist/js/treeshaking/config/index.js +3 -2
- package/dist/js/treeshaking/config/initial/createHtmlConfig.js +19 -31
- package/dist/js/treeshaking/config/initial/createOutputConfig.js +43 -67
- package/dist/js/treeshaking/config/initial/createSourceConfig.js +37 -40
- package/dist/js/treeshaking/config/initial/createToolsConfig.js +23 -38
- package/dist/js/treeshaking/config/initial/index.js +10 -9
- package/dist/js/treeshaking/config/initial/inits.js +205 -106
- package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +27 -34
- package/dist/js/treeshaking/defineConfig.js +60 -13
- package/dist/js/treeshaking/exports/server.js +2 -1
- package/dist/js/treeshaking/hooks.js +30 -25
- package/dist/js/treeshaking/index.js +681 -256
- package/dist/js/treeshaking/initialize/index.js +290 -112
- package/dist/js/treeshaking/locale/en.js +34 -33
- package/dist/js/treeshaking/locale/index.js +5 -5
- package/dist/js/treeshaking/locale/zh.js +34 -33
- package/dist/js/treeshaking/schema/Schema.js +267 -69
- package/dist/js/treeshaking/schema/index.js +165 -121
- package/dist/js/treeshaking/schema/legacy.js +323 -256
- package/dist/js/treeshaking/types/config/deploy.js +1 -0
- package/dist/js/treeshaking/types/config/dev.js +1 -0
- package/dist/js/treeshaking/types/config/experiments.js +1 -0
- package/dist/js/treeshaking/types/config/html.js +1 -0
- package/dist/js/treeshaking/types/config/index.js +0 -1
- package/dist/js/treeshaking/types/config/output.js +1 -0
- package/dist/js/treeshaking/types/config/performance.js +1 -0
- package/dist/js/treeshaking/types/config/security.js +1 -0
- package/dist/js/treeshaking/types/config/source.js +1 -0
- package/dist/js/treeshaking/types/config/tools.js +1 -0
- package/dist/js/treeshaking/types/hooks.js +1 -0
- package/dist/js/treeshaking/types/index.js +0 -1
- package/dist/js/treeshaking/types/legacyConfig/deploy.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/dev.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/index.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/output.js +1 -1
- package/dist/js/treeshaking/types/legacyConfig/source.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/tools.js +1 -0
- package/dist/js/treeshaking/utils/commands.js +6 -5
- package/dist/js/treeshaking/utils/config.js +295 -117
- package/dist/js/treeshaking/utils/createFileWatcher.js +278 -118
- package/dist/js/treeshaking/utils/createServer.js +252 -67
- package/dist/js/treeshaking/utils/getSpecifiedEntries.js +182 -55
- package/dist/js/treeshaking/utils/language.js +6 -5
- package/dist/js/treeshaking/utils/printInstructions.js +151 -29
- package/dist/js/treeshaking/utils/restart.js +184 -42
- package/dist/js/treeshaking/utils/routes.js +151 -27
- package/dist/js/treeshaking/utils/types.js +1 -0
- package/dist/types/analyze/Builder.d.ts +8 -0
- package/dist/types/analyze/constants.d.ts +2 -0
- package/dist/types/analyze/index.d.ts +2 -0
- package/dist/types/analyze/templates.d.ts +10 -7
- package/dist/types/analyze/utils.d.ts +9 -1
- package/dist/types/builder/builderPlugins/compatModern.d.ts +2 -1
- package/dist/types/builder/index.d.ts +3 -3
- package/dist/types/builder/loaders/routerLoader.d.ts +3 -0
- package/dist/types/builder/loaders/serverModuleLoader.d.ts +3 -0
- package/dist/types/builder/webpackPlugins/routerPlugin.d.ts +1 -7
- package/dist/types/defineConfig.d.ts +1 -0
- package/dist/types/index.d.ts +6 -1
- package/dist/types/initialize/index.d.ts +2 -0
- package/dist/types/types/config/dev.d.ts +2 -2
- package/dist/types/types/config/index.d.ts +1 -0
- package/dist/types/types/config/output.d.ts +0 -1
- package/dist/types/types/config/source.d.ts +1 -0
- package/dist/types/types/config/tools.d.ts +10 -1
- package/dist/types/types/hooks.d.ts +7 -1
- package/dist/types/types/legacyConfig/dev.d.ts +1 -0
- package/dist/types/types/legacyConfig/output.d.ts +1 -1
- package/dist/types/types/legacyConfig/source.d.ts +1 -0
- package/dist/types/types/legacyConfig/tools.d.ts +1 -0
- package/dist/types/utils/config.d.ts +1 -0
- package/dist/types/utils/createFileWatcher.d.ts +2 -1
- package/dist/types/utils/createServer.d.ts +1 -0
- package/dist/types/utils/restart.d.ts +1 -1
- package/lib/types.d.ts +1 -1
- package/package.json +26 -22
|
@@ -1,73 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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 stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
build: () => build
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_core = require("@modern-js/core");
|
|
24
|
+
var import_utils = require("@modern-js/utils");
|
|
25
|
+
var import_routes = require("../utils/routes");
|
|
26
|
+
var import_config = require("../utils/config");
|
|
27
|
+
var __defProp2 = Object.defineProperty;
|
|
28
|
+
var __defProps = Object.defineProperties;
|
|
29
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
30
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
31
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
32
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
33
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
34
|
+
var __spreadValues = (a, b) => {
|
|
35
|
+
for (var prop in b || (b = {}))
|
|
36
|
+
if (__hasOwnProp2.call(b, prop))
|
|
37
|
+
__defNormalProp(a, prop, b[prop]);
|
|
38
|
+
if (__getOwnPropSymbols)
|
|
39
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
40
|
+
if (__propIsEnum.call(b, prop))
|
|
41
|
+
__defNormalProp(a, prop, b[prop]);
|
|
42
|
+
}
|
|
43
|
+
return a;
|
|
44
|
+
};
|
|
45
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
46
|
+
var __async = (__this, __arguments, generator) => {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
var fulfilled = (value) => {
|
|
49
|
+
try {
|
|
50
|
+
step(generator.next(value));
|
|
51
|
+
} catch (e) {
|
|
52
|
+
reject(e);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var rejected = (value) => {
|
|
56
|
+
try {
|
|
57
|
+
step(generator.throw(value));
|
|
58
|
+
} catch (e) {
|
|
59
|
+
reject(e);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
63
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const build = (api, options) => __async(void 0, null, function* () {
|
|
67
|
+
if (options == null ? void 0 : options.analyze) {
|
|
68
|
+
process.env.BUNDLE_ANALYZE = "true";
|
|
18
69
|
}
|
|
19
70
|
let resolvedConfig = api.useResolvedConfigContext();
|
|
20
71
|
const appContext = api.useAppContext();
|
|
21
72
|
const hookRunners = api.useHookRunners();
|
|
22
|
-
const {
|
|
23
|
-
apiOnly
|
|
24
|
-
} = appContext;
|
|
73
|
+
const { apiOnly } = appContext;
|
|
25
74
|
if (apiOnly) {
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
serverConfigFile
|
|
30
|
-
} = appContext;
|
|
31
|
-
await hookRunners.beforeBuild({
|
|
32
|
-
// "null" bundlerConfigs
|
|
33
|
-
bundlerConfigs: undefined
|
|
75
|
+
const { appDirectory: appDirectory2, distDirectory: distDirectory2, serverConfigFile: serverConfigFile2 } = appContext;
|
|
76
|
+
yield hookRunners.beforeBuild({
|
|
77
|
+
bundlerConfigs: void 0
|
|
34
78
|
});
|
|
35
|
-
|
|
36
|
-
appDirectory,
|
|
37
|
-
distDirectory,
|
|
38
|
-
configFile:
|
|
79
|
+
yield (0, import_config.buildServerConfig)({
|
|
80
|
+
appDirectory: appDirectory2,
|
|
81
|
+
distDirectory: distDirectory2,
|
|
82
|
+
configFile: serverConfigFile2
|
|
39
83
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
stats: undefined
|
|
84
|
+
yield (0, import_routes.generateRoutes)(appContext);
|
|
85
|
+
yield hookRunners.afterBuild({
|
|
86
|
+
stats: void 0
|
|
44
87
|
});
|
|
45
88
|
return;
|
|
46
89
|
}
|
|
47
|
-
resolvedConfig =
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const {
|
|
52
|
-
distDirectory,
|
|
53
|
-
appDirectory,
|
|
54
|
-
serverConfigFile
|
|
55
|
-
} = appContext;
|
|
56
|
-
await (0, _config.buildServerConfig)({
|
|
90
|
+
resolvedConfig = __spreadProps(__spreadValues({}, resolvedConfig), { cliOptions: options });
|
|
91
|
+
import_core.ResolvedConfigContext.set(resolvedConfig);
|
|
92
|
+
const { distDirectory, appDirectory, serverConfigFile } = appContext;
|
|
93
|
+
yield (0, import_config.buildServerConfig)({
|
|
57
94
|
appDirectory,
|
|
58
95
|
distDirectory,
|
|
59
96
|
configFile: serverConfigFile
|
|
60
97
|
});
|
|
61
98
|
try {
|
|
62
|
-
|
|
99
|
+
import_utils.logger.info("Create a production build...\n");
|
|
63
100
|
if (!appContext.builder) {
|
|
64
|
-
throw new Error(
|
|
101
|
+
throw new Error(
|
|
102
|
+
"Expect the Builder to have been initialized, But the appContext.builder received `undefined`"
|
|
103
|
+
);
|
|
65
104
|
}
|
|
66
|
-
|
|
105
|
+
yield appContext.builder.build();
|
|
67
106
|
} catch (error) {
|
|
68
|
-
(0,
|
|
69
|
-
// eslint-disable-next-line no-process-exit
|
|
107
|
+
(0, import_utils.printBuildError)(error);
|
|
70
108
|
process.exit(1);
|
|
71
109
|
}
|
|
72
|
-
};
|
|
73
|
-
exports.build = build;
|
|
110
|
+
});
|
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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 stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
deploy: () => deploy
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var __async = (__this, __arguments, generator) => {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
var fulfilled = (value) => {
|
|
26
|
+
try {
|
|
27
|
+
step(generator.next(value));
|
|
28
|
+
} catch (e) {
|
|
29
|
+
reject(e);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var rejected = (value) => {
|
|
33
|
+
try {
|
|
34
|
+
step(generator.throw(value));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
reject(e);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
40
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
41
|
+
});
|
|
11
42
|
};
|
|
12
|
-
|
|
43
|
+
const deploy = (api, options) => __async(void 0, null, function* () {
|
|
44
|
+
const hookRunners = api.useHookRunners();
|
|
45
|
+
yield hookRunners.beforeDeploy(options);
|
|
46
|
+
yield hookRunners.afterDeploy(options);
|
|
47
|
+
});
|
|
@@ -1,33 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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 stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
dev: () => dev
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_core = require("@modern-js/core");
|
|
24
|
+
var import_createFileWatcher = require("../utils/createFileWatcher");
|
|
25
|
+
var import_printInstructions = require("../utils/printInstructions");
|
|
26
|
+
var import_createServer = require("../utils/createServer");
|
|
27
|
+
var import_routes = require("../utils/routes");
|
|
28
|
+
var import_getSpecifiedEntries = require("../utils/getSpecifiedEntries");
|
|
29
|
+
var import_config = require("../utils/config");
|
|
30
|
+
var __defProp2 = Object.defineProperty;
|
|
31
|
+
var __defProps = Object.defineProperties;
|
|
32
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
33
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
34
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
35
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
36
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
37
|
+
var __spreadValues = (a, b) => {
|
|
38
|
+
for (var prop in b || (b = {}))
|
|
39
|
+
if (__hasOwnProp2.call(b, prop))
|
|
40
|
+
__defNormalProp(a, prop, b[prop]);
|
|
41
|
+
if (__getOwnPropSymbols)
|
|
42
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
43
|
+
if (__propIsEnum.call(b, prop))
|
|
44
|
+
__defNormalProp(a, prop, b[prop]);
|
|
45
|
+
}
|
|
46
|
+
return a;
|
|
47
|
+
};
|
|
48
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
49
|
+
var __async = (__this, __arguments, generator) => {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
var fulfilled = (value) => {
|
|
52
|
+
try {
|
|
53
|
+
step(generator.next(value));
|
|
54
|
+
} catch (e) {
|
|
55
|
+
reject(e);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var rejected = (value) => {
|
|
59
|
+
try {
|
|
60
|
+
step(generator.throw(value));
|
|
61
|
+
} catch (e) {
|
|
62
|
+
reject(e);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
66
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
const dev = (api, options) => __async(void 0, null, function* () {
|
|
70
|
+
var _a;
|
|
20
71
|
if (options.analyze) {
|
|
21
|
-
|
|
22
|
-
process.env.BUNDLE_ANALYZE = 'true';
|
|
72
|
+
process.env.BUNDLE_ANALYZE = "true";
|
|
23
73
|
}
|
|
24
74
|
let normalizedConfig = api.useResolvedConfigContext();
|
|
25
75
|
const appContext = api.useAppContext();
|
|
26
76
|
const hookRunners = api.useHookRunners();
|
|
27
|
-
normalizedConfig =
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
_core.ResolvedConfigContext.set(normalizedConfig);
|
|
77
|
+
normalizedConfig = __spreadProps(__spreadValues({}, normalizedConfig), { cliOptions: options });
|
|
78
|
+
import_core.ResolvedConfigContext.set(normalizedConfig);
|
|
31
79
|
const {
|
|
32
80
|
appDirectory,
|
|
33
81
|
distDirectory,
|
|
@@ -37,12 +85,15 @@ const dev = async (api, options) => {
|
|
|
37
85
|
serverConfigFile,
|
|
38
86
|
serverInternalPlugins
|
|
39
87
|
} = appContext;
|
|
40
|
-
const checkedEntries =
|
|
41
|
-
|
|
88
|
+
const checkedEntries = yield (0, import_getSpecifiedEntries.getSpecifiedEntries)(
|
|
89
|
+
options.entry || false,
|
|
90
|
+
entrypoints
|
|
91
|
+
);
|
|
92
|
+
api.setAppContext(__spreadProps(__spreadValues({}, appContext), {
|
|
42
93
|
checkedEntries
|
|
43
94
|
}));
|
|
44
95
|
appContext.checkedEntries = checkedEntries;
|
|
45
|
-
|
|
96
|
+
yield (0, import_config.buildServerConfig)({
|
|
46
97
|
appDirectory,
|
|
47
98
|
distDirectory,
|
|
48
99
|
configFile: serverConfigFile,
|
|
@@ -52,44 +103,47 @@ const dev = async (api, options) => {
|
|
|
52
103
|
}
|
|
53
104
|
}
|
|
54
105
|
});
|
|
55
|
-
|
|
56
|
-
let compiler
|
|
106
|
+
yield hookRunners.beforeDev();
|
|
107
|
+
let compiler;
|
|
108
|
+
if (!appContext.builder && !apiOnly) {
|
|
109
|
+
throw new Error(
|
|
110
|
+
"Expect the Builder to have been initialized, But the appContext.builder received `undefined`"
|
|
111
|
+
);
|
|
112
|
+
}
|
|
57
113
|
if (!apiOnly) {
|
|
58
|
-
|
|
59
|
-
throw new Error('Expect the Builder to have been initialized, But the appContext.builder received `undefined`');
|
|
60
|
-
}
|
|
61
|
-
compiler = await appContext.builder.createCompiler();
|
|
114
|
+
compiler = yield appContext.builder.createCompiler();
|
|
62
115
|
}
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
dev:
|
|
66
|
-
client: {
|
|
67
|
-
port: port.toString()
|
|
68
|
-
},
|
|
69
|
-
devMiddleware: {
|
|
70
|
-
writeToDisk: file => !file.includes('.hot-update.')
|
|
71
|
-
},
|
|
72
|
-
hot: true,
|
|
73
|
-
liveReload: true,
|
|
116
|
+
yield (0, import_routes.generateRoutes)(appContext);
|
|
117
|
+
const serverOptions = {
|
|
118
|
+
dev: __spreadValues({
|
|
74
119
|
port,
|
|
75
120
|
https: normalizedConfig.dev.https
|
|
76
|
-
}
|
|
77
|
-
compiler,
|
|
121
|
+
}, (_a = normalizedConfig.tools) == null ? void 0 : _a.devServer),
|
|
122
|
+
compiler: compiler || null,
|
|
78
123
|
pwd: appDirectory,
|
|
79
124
|
config: normalizedConfig,
|
|
80
125
|
serverConfigFile,
|
|
81
|
-
internalPlugins: (0,
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
126
|
+
internalPlugins: (0, import_createServer.injectDataLoaderPlugin)(serverInternalPlugins)
|
|
127
|
+
};
|
|
128
|
+
if (apiOnly) {
|
|
129
|
+
const app = yield (0, import_createServer.createServer)(serverOptions);
|
|
130
|
+
app.listen(port, (err) => __async(void 0, null, function* () {
|
|
131
|
+
if (err) {
|
|
132
|
+
throw err;
|
|
133
|
+
}
|
|
134
|
+
(0, import_printInstructions.printInstructions)(hookRunners, appContext, normalizedConfig);
|
|
135
|
+
}));
|
|
136
|
+
} else {
|
|
137
|
+
const { server } = yield appContext.builder.startDevServer({
|
|
138
|
+
compiler,
|
|
139
|
+
printURLs: false,
|
|
140
|
+
serverOptions
|
|
141
|
+
});
|
|
142
|
+
(0, import_createServer.setServer)(server);
|
|
143
|
+
}
|
|
144
|
+
yield (0, import_createFileWatcher.createFileWatcher)(
|
|
145
|
+
appContext,
|
|
146
|
+
normalizedConfig.source.configDir,
|
|
147
|
+
hookRunners
|
|
148
|
+
);
|
|
149
|
+
});
|
|
@@ -1,38 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (key in exports && exports[key] === _build[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _build[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _start = require("./start");
|
|
29
|
-
Object.keys(_start).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _start[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _start[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var stdin_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
17
|
+
__reExport(stdin_exports, require("./dev"), module.exports);
|
|
18
|
+
__reExport(stdin_exports, require("./build"), module.exports);
|
|
19
|
+
__reExport(stdin_exports, require("./start"), module.exports);
|
|
@@ -1,20 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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 stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
inspect: () => inspect
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_path = require("path");
|
|
24
|
+
var __async = (__this, __arguments, generator) => {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
var fulfilled = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.next(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var rejected = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.throw(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const inspect = (api, options) => __async(void 0, null, function* () {
|
|
9
45
|
const appContext = api.useAppContext();
|
|
10
46
|
if (!appContext.builder) {
|
|
11
|
-
throw new Error(
|
|
47
|
+
throw new Error(
|
|
48
|
+
"Expect the Builder to have been initialized, But the appContext.builder received `undefined`"
|
|
49
|
+
);
|
|
12
50
|
}
|
|
13
51
|
return appContext.builder.inspectConfig({
|
|
14
52
|
env: options.env,
|
|
15
53
|
verbose: options.verbose,
|
|
16
|
-
outputPath: (0,
|
|
54
|
+
outputPath: (0, import_path.join)(appContext == null ? void 0 : appContext.builder.context.distPath, options.output),
|
|
17
55
|
writeToDisk: true
|
|
18
56
|
});
|
|
19
|
-
};
|
|
20
|
-
exports.inspect = inspect;
|
|
57
|
+
});
|
|
@@ -1,39 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var stdin_exports = {};
|
|
25
|
+
__export(stdin_exports, {
|
|
26
|
+
start: () => start
|
|
5
27
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
28
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
29
|
+
var import_utils = require("@modern-js/utils");
|
|
30
|
+
var import_prod_server = __toESM(require("@modern-js/prod-server"));
|
|
31
|
+
var import_printInstructions = require("../utils/printInstructions");
|
|
32
|
+
var import_createServer = require("../utils/createServer");
|
|
33
|
+
var __async = (__this, __arguments, generator) => {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
var fulfilled = (value) => {
|
|
36
|
+
try {
|
|
37
|
+
step(generator.next(value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var rejected = (value) => {
|
|
43
|
+
try {
|
|
44
|
+
step(generator.throw(value));
|
|
45
|
+
} catch (e) {
|
|
46
|
+
reject(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
const start = (api) => __async(void 0, null, function* () {
|
|
54
|
+
var _a;
|
|
14
55
|
const appContext = api.useAppContext();
|
|
15
56
|
const userConfig = api.useResolvedConfigContext();
|
|
16
57
|
const hookRunners = api.useHookRunners();
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const app = await (0, _prodServer.default)({
|
|
58
|
+
const { appDirectory, port, serverConfigFile } = appContext;
|
|
59
|
+
import_utils.logger.log(import_utils.chalk.cyan(`Starting the modern server...`));
|
|
60
|
+
const apiOnly = yield (0, import_utils.isApiOnly)(
|
|
61
|
+
appContext.appDirectory,
|
|
62
|
+
(_a = userConfig == null ? void 0 : userConfig.source) == null ? void 0 : _a.entriesDir
|
|
63
|
+
);
|
|
64
|
+
const app = yield (0, import_prod_server.default)({
|
|
25
65
|
pwd: appDirectory,
|
|
26
|
-
// FIXME: remove the `any` type
|
|
27
66
|
config: userConfig,
|
|
28
67
|
serverConfigFile,
|
|
29
|
-
internalPlugins: (0,
|
|
68
|
+
internalPlugins: (0, import_createServer.injectDataLoaderPlugin)(appContext.serverInternalPlugins),
|
|
30
69
|
apiOnly
|
|
31
70
|
});
|
|
32
|
-
app.listen(port,
|
|
71
|
+
app.listen(port, (err) => __async(void 0, null, function* () {
|
|
33
72
|
if (err) {
|
|
34
73
|
throw err;
|
|
35
74
|
}
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
exports.start = start;
|
|
75
|
+
yield (0, import_printInstructions.printInstructions)(hookRunners, appContext, userConfig);
|
|
76
|
+
}));
|
|
77
|
+
});
|