@modern-js/app-tools 2.63.0 → 2.63.1-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/modern.js +1 -1
- package/dist/cjs/commands/build.js +19 -13
- package/dist/cjs/commands/deploy.js +5 -5
- package/dist/cjs/commands/dev.js +11 -11
- package/dist/cjs/commands/index.js +6 -6
- package/dist/cjs/commands/inspect.js +1 -1
- package/dist/cjs/commands/serve.js +4 -4
- package/dist/cjs/{new/compat → compat}/hooks.js +15 -8
- package/dist/cjs/{new/compat → compat}/index.js +4 -1
- package/dist/cjs/{new/compat → compat}/utils.js +10 -1
- package/dist/cjs/index.js +154 -5
- package/dist/cjs/plugins/analyze/getBundleEntry.js +2 -2
- package/dist/cjs/plugins/analyze/getFileSystemEntry.js +9 -9
- package/dist/cjs/plugins/analyze/getHtmlTemplate.js +51 -25
- package/dist/cjs/plugins/analyze/index.js +128 -130
- package/dist/cjs/plugins/deploy/index.js +12 -14
- package/dist/cjs/plugins/initialize/index.js +1 -1
- package/dist/cjs/plugins/serverBuild.js +30 -32
- package/dist/cjs/{new/run.js → run/index.js} +6 -6
- package/dist/cjs/{new → utils}/getConfigFile.js +1 -1
- package/dist/cjs/{new/context.js → utils/initAppContext.js} +3 -4
- package/dist/cjs/{new/utils/index.js → utils/isAutoLoadPlugins.js} +6 -6
- package/dist/cjs/utils/loadPlugins.js +35 -4
- package/dist/cjs/utils/printInstructions.js +2 -2
- package/dist/cjs/utils/restart.js +4 -3
- package/dist/esm/commands/build.js +18 -12
- package/dist/esm/commands/deploy.js +6 -6
- package/dist/esm/commands/dev.js +10 -10
- package/dist/esm/commands/index.js +8 -8
- package/dist/esm/commands/inspect.js +1 -1
- package/dist/esm/commands/serve.js +5 -5
- package/dist/esm/{new/compat → compat}/hooks.js +41 -41
- package/dist/esm/{new/compat → compat}/index.js +4 -1
- package/dist/esm/{new/compat → compat}/utils.js +10 -1
- package/dist/esm/index.js +245 -2
- package/dist/esm/plugins/analyze/getBundleEntry.js +3 -3
- package/dist/esm/plugins/analyze/getFileSystemEntry.js +12 -12
- package/dist/esm/plugins/analyze/getHtmlTemplate.js +101 -28
- package/dist/esm/plugins/analyze/index.js +328 -331
- package/dist/esm/plugins/deploy/index.js +84 -88
- package/dist/esm/plugins/initialize/index.js +1 -1
- package/dist/esm/plugins/serverBuild.js +52 -56
- package/dist/esm/{new/run.js → run/index.js} +6 -6
- package/dist/esm/{new → utils}/getConfigFile.js +1 -1
- package/dist/esm/{new/context.js → utils/initAppContext.js} +0 -1
- package/dist/esm/{new/utils/index.js → utils/isAutoLoadPlugins.js} +6 -6
- package/dist/esm/utils/loadPlugins.js +95 -7
- package/dist/esm/utils/printInstructions.js +3 -3
- package/dist/esm/utils/restart.js +5 -4
- package/dist/esm-node/commands/build.js +19 -13
- package/dist/esm-node/commands/deploy.js +5 -5
- package/dist/esm-node/commands/dev.js +11 -11
- package/dist/esm-node/commands/index.js +6 -6
- package/dist/esm-node/commands/inspect.js +1 -1
- package/dist/esm-node/commands/serve.js +4 -4
- package/dist/esm-node/{new/compat → compat}/hooks.js +15 -8
- package/dist/esm-node/{new/compat → compat}/index.js +4 -1
- package/dist/esm-node/{new/compat → compat}/utils.js +10 -1
- package/dist/esm-node/index.js +140 -2
- package/dist/esm-node/plugins/analyze/getBundleEntry.js +2 -2
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.js +9 -9
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.js +49 -24
- package/dist/esm-node/plugins/analyze/index.js +128 -130
- package/dist/esm-node/plugins/deploy/index.js +12 -14
- package/dist/esm-node/plugins/initialize/index.js +1 -1
- package/dist/esm-node/plugins/serverBuild.js +30 -32
- package/dist/esm-node/{new/run.js → run/index.js} +6 -6
- package/dist/esm-node/{new → utils}/getConfigFile.js +1 -1
- package/dist/esm-node/{new/context.js → utils/initAppContext.js} +0 -1
- package/dist/esm-node/{new/utils/index.js → utils/isAutoLoadPlugins.js} +2 -2
- package/dist/esm-node/utils/loadPlugins.js +34 -4
- package/dist/esm-node/utils/printInstructions.js +2 -2
- package/dist/esm-node/utils/restart.js +4 -3
- package/dist/types/builder/generator/adapterCopy.d.ts +2 -1
- package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -2
- package/dist/types/builder/generator/createCopyPattern.d.ts +4 -3
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +2 -2
- package/dist/types/builder/index.d.ts +1 -1
- package/dist/types/builder/shared/createCopyInfo.d.ts +3 -2
- package/dist/types/builder/shared/types.d.ts +3 -2
- package/dist/types/commands/build.d.ts +2 -2
- package/dist/types/commands/deploy.d.ts +2 -2
- package/dist/types/commands/dev.d.ts +2 -2
- package/dist/types/commands/index.d.ts +6 -6
- package/dist/types/commands/inspect.d.ts +2 -2
- package/dist/types/commands/serve.d.ts +2 -2
- package/dist/types/{new/compat → compat}/hooks.d.ts +2 -2
- package/dist/types/compat/index.d.ts +2 -0
- package/dist/types/config/initialize/index.d.ts +3 -2
- package/dist/types/config/initialize/inits.d.ts +4 -3
- package/dist/types/index.d.ts +5 -3
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +3 -3
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +3 -3
- package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +26 -5
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +2 -2
- package/dist/types/plugins/analyze/index.d.ts +2 -3
- package/dist/types/plugins/deploy/index.d.ts +2 -3
- package/dist/types/plugins/deploy/platforms/platform.d.ts +3 -3
- package/dist/types/plugins/deploy/utils.d.ts +2 -2
- package/dist/types/plugins/serverBuild.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/new.d.ts +46 -34
- package/dist/types/utils/generateWatchFiles.d.ts +2 -2
- package/dist/types/{new/context.d.ts → utils/initAppContext.d.ts} +0 -1
- package/dist/types/utils/isAutoLoadPlugins.d.ts +1 -0
- package/dist/types/utils/loadPlugins.d.ts +13 -3
- package/dist/types/utils/printInstructions.d.ts +3 -3
- package/dist/types/utils/restart.d.ts +2 -3
- package/dist/types/utils/routes.d.ts +2 -1
- package/package.json +14 -15
- package/dist/cjs/hooks.js +0 -60
- package/dist/cjs/new/index.js +0 -79
- package/dist/cjs/new/loadPlugins.js +0 -57
- package/dist/cjs/old.js +0 -179
- package/dist/esm/hooks.js +0 -36
- package/dist/esm/new/index.js +0 -55
- package/dist/esm/new/loadPlugins.js +0 -94
- package/dist/esm/old.js +0 -258
- package/dist/esm-node/hooks.js +0 -36
- package/dist/esm-node/new/index.js +0 -52
- package/dist/esm-node/new/loadPlugins.js +0 -33
- package/dist/esm-node/old.js +0 -140
- package/dist/types/hooks.d.ts +0 -2
- package/dist/types/new/compat/index.d.ts +0 -2
- package/dist/types/new/index.d.ts +0 -6
- package/dist/types/new/loadPlugins.d.ts +0 -9
- package/dist/types/new/utils/index.d.ts +0 -1
- package/dist/types/old.d.ts +0 -13
- /package/dist/cjs/{new/constants.js → constants.js} +0 -0
- /package/dist/esm/{new/constants.js → constants.js} +0 -0
- /package/dist/esm-node/{new/constants.js → constants.js} +0 -0
- /package/dist/types/{new/compat → compat}/utils.d.ts +0 -0
- /package/dist/types/{new/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/types/{new/run.d.ts → run/index.d.ts} +0 -0
- /package/dist/types/{new → utils}/getConfigFile.d.ts +0 -0
@@ -23,347 +23,344 @@ function analyze_default(param) {
|
|
23
23
|
setup: function(api) {
|
24
24
|
var pagesDir = [];
|
25
25
|
var nestedRouteEntries = [];
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
26
|
+
api.onPrepare(/* @__PURE__ */ _async_to_generator(function() {
|
27
|
+
var _resolvedConfig_source, appContext, resolvedConfig, hooks, apiOnly, routes, _ref, getBundleEntry, getServerRoutes, getHtmlTemplate, entrypoints, _, _1, _tmp, initialRoutes, routes1, _ref1, partialsByEntrypoint, htmlTemplates, checkedEntries, entry, normalizedConfig, createBuilderForModern, builder;
|
28
|
+
return _ts_generator(this, function(_state) {
|
29
|
+
switch (_state.label) {
|
30
|
+
case 0:
|
31
|
+
appContext = api.getAppContext();
|
32
|
+
resolvedConfig = api.getNormalizedConfig();
|
33
|
+
hooks = api.getHooks();
|
34
|
+
try {
|
35
|
+
if (checkIsBuildCommands()) {
|
36
|
+
fs.emptydirSync(appContext.internalDirectory);
|
37
|
+
}
|
38
|
+
} catch (e) {
|
39
|
+
}
|
40
|
+
return [
|
41
|
+
4,
|
42
|
+
isApiOnly(appContext.appDirectory, (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.entriesDir, appContext.apiDirectory)
|
43
|
+
];
|
44
|
+
case 1:
|
45
|
+
apiOnly = _state.sent();
|
46
|
+
return [
|
47
|
+
4,
|
48
|
+
hooks.addRuntimeExports.call()
|
49
|
+
];
|
50
|
+
case 2:
|
51
|
+
_state.sent();
|
52
|
+
if (!apiOnly)
|
53
|
+
return [
|
54
|
+
3,
|
55
|
+
4
|
56
|
+
];
|
57
|
+
return [
|
58
|
+
4,
|
59
|
+
hooks.modifyServerRoutes.call({
|
60
|
+
routes: []
|
61
|
+
})
|
62
|
+
];
|
63
|
+
case 3:
|
64
|
+
routes = _state.sent().routes;
|
65
|
+
debug("server routes: %o", routes);
|
66
|
+
api.updateAppContext({
|
67
|
+
apiOnly,
|
68
|
+
serverRoutes: routes
|
69
|
+
});
|
70
|
+
return [
|
71
|
+
2
|
72
|
+
];
|
73
|
+
case 4:
|
74
|
+
return [
|
75
|
+
4,
|
76
|
+
Promise.all([
|
77
|
+
import("./getBundleEntry.js"),
|
78
|
+
import("./getServerRoutes.js"),
|
79
|
+
import("./getHtmlTemplate.js")
|
80
|
+
])
|
81
|
+
];
|
82
|
+
case 5:
|
83
|
+
_ref = _sliced_to_array.apply(void 0, [
|
84
|
+
_state.sent(),
|
85
|
+
3
|
86
|
+
]), getBundleEntry = _ref[0].getBundleEntry, getServerRoutes = _ref[1].getServerRoutes, getHtmlTemplate = _ref[2].getHtmlTemplate;
|
87
|
+
_1 = (_ = hooks.modifyEntrypoints).call;
|
88
|
+
_tmp = {};
|
89
|
+
return [
|
90
|
+
4,
|
91
|
+
getBundleEntry(hooks, appContext, resolvedConfig)
|
92
|
+
];
|
93
|
+
case 6:
|
94
|
+
return [
|
95
|
+
4,
|
96
|
+
_1.apply(_, [
|
97
|
+
(_tmp.entrypoints = _state.sent(), _tmp)
|
98
|
+
])
|
99
|
+
];
|
100
|
+
case 7:
|
101
|
+
entrypoints = _state.sent().entrypoints;
|
102
|
+
debug("entrypoints: %o", entrypoints);
|
103
|
+
initialRoutes = getServerRoutes(entrypoints, {
|
104
|
+
appContext,
|
105
|
+
config: resolvedConfig
|
106
|
+
});
|
107
|
+
return [
|
108
|
+
4,
|
109
|
+
hooks.modifyServerRoutes.call({
|
110
|
+
routes: initialRoutes
|
111
|
+
})
|
112
|
+
];
|
113
|
+
case 8:
|
114
|
+
routes1 = _state.sent().routes;
|
115
|
+
debug("server routes: %o", routes1);
|
116
|
+
appContext = _object_spread_props(_object_spread({}, api.getAppContext()), {
|
117
|
+
entrypoints,
|
118
|
+
serverRoutes: routes1
|
119
|
+
});
|
120
|
+
api.updateAppContext(appContext);
|
121
|
+
nestedRouteEntries = entrypoints.map(function(point) {
|
122
|
+
return point.nestedRoutesEntry;
|
123
|
+
}).filter(Boolean);
|
124
|
+
pagesDir = entrypoints.map(function(point) {
|
125
|
+
return point.entry;
|
126
|
+
}).filter(function(entry2) {
|
127
|
+
return entry2 && !path.extname(entry2);
|
128
|
+
}).concat(nestedRouteEntries);
|
129
|
+
return [
|
130
|
+
4,
|
131
|
+
getHtmlTemplate(entrypoints, hooks, {
|
132
|
+
appContext,
|
133
|
+
config: resolvedConfig
|
134
|
+
})
|
135
|
+
];
|
136
|
+
case 9:
|
137
|
+
_ref1 = _state.sent(), partialsByEntrypoint = _ref1.partialsByEntrypoint, htmlTemplates = _ref1.htmlTemplates;
|
138
|
+
debug("html templates: %o", htmlTemplates);
|
139
|
+
api.updateAppContext({
|
140
|
+
partialsByEntrypoint
|
141
|
+
});
|
142
|
+
checkedEntries = entrypoints.map(function(point) {
|
143
|
+
return point.entryName;
|
144
|
+
});
|
145
|
+
if (!isDevCommand())
|
146
|
+
return [
|
147
|
+
3,
|
148
|
+
11
|
149
|
+
];
|
150
|
+
entry = minimist(getArgv()).entry;
|
151
|
+
return [
|
152
|
+
4,
|
153
|
+
getSelectedEntries(typeof entry === "string" ? entry.split(",") : entry, entrypoints)
|
154
|
+
];
|
155
|
+
case 10:
|
156
|
+
checkedEntries = _state.sent();
|
157
|
+
_state.label = 11;
|
158
|
+
case 11:
|
159
|
+
appContext = _object_spread_props(_object_spread({}, api.getAppContext()), {
|
160
|
+
entrypoints,
|
161
|
+
checkedEntries,
|
162
|
+
apiOnly,
|
163
|
+
serverRoutes: routes1,
|
164
|
+
htmlTemplates
|
165
|
+
});
|
166
|
+
api.updateAppContext(appContext);
|
167
|
+
if (!checkIsBuildCommands())
|
168
|
+
return [
|
169
|
+
3,
|
170
|
+
15
|
171
|
+
];
|
172
|
+
return [
|
173
|
+
4,
|
174
|
+
hooks.generateEntryCode.call({
|
175
|
+
entrypoints
|
176
|
+
})
|
177
|
+
];
|
178
|
+
case 12:
|
179
|
+
_state.sent();
|
180
|
+
normalizedConfig = api.getNormalizedConfig();
|
181
|
+
return [
|
182
|
+
4,
|
183
|
+
createBuilderGenerator(bundler)
|
184
|
+
];
|
185
|
+
case 13:
|
186
|
+
createBuilderForModern = _state.sent();
|
187
|
+
return [
|
188
|
+
4,
|
189
|
+
createBuilderForModern({
|
190
|
+
normalizedConfig,
|
191
|
+
appContext
|
192
|
+
})
|
193
|
+
];
|
194
|
+
case 14:
|
195
|
+
builder = _state.sent();
|
196
|
+
builder.onBeforeBuild(function() {
|
197
|
+
var _ref2 = _async_to_generator(function(param2) {
|
198
|
+
var bundlerConfigs, isFirstCompile, environments, isWatch;
|
199
|
+
return _ts_generator(this, function(_state2) {
|
200
|
+
switch (_state2.label) {
|
201
|
+
case 0:
|
202
|
+
bundlerConfigs = param2.bundlerConfigs, isFirstCompile = param2.isFirstCompile, environments = param2.environments, isWatch = param2.isWatch;
|
203
|
+
if (!isFirstCompile) {
|
204
|
+
return [
|
205
|
+
2
|
206
|
+
];
|
207
|
+
}
|
208
|
+
return [
|
209
|
+
4,
|
210
|
+
generateRoutes(appContext)
|
211
|
+
];
|
212
|
+
case 1:
|
213
|
+
_state2.sent();
|
214
|
+
return [
|
215
|
+
4,
|
216
|
+
hooks.onBeforeBuild.call({
|
217
|
+
isFirstCompile,
|
218
|
+
isWatch,
|
219
|
+
environments,
|
220
|
+
bundlerConfigs
|
221
|
+
})
|
222
|
+
];
|
223
|
+
case 2:
|
224
|
+
_state2.sent();
|
225
|
+
return [
|
226
|
+
2
|
227
|
+
];
|
39
228
|
}
|
40
|
-
} catch (e) {
|
41
|
-
}
|
42
|
-
return [
|
43
|
-
4,
|
44
|
-
isApiOnly(appContext.appDirectory, (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.entriesDir, appContext.apiDirectory)
|
45
|
-
];
|
46
|
-
case 1:
|
47
|
-
apiOnly = _state.sent();
|
48
|
-
return [
|
49
|
-
4,
|
50
|
-
hookRunners.addRuntimeExports()
|
51
|
-
];
|
52
|
-
case 2:
|
53
|
-
_state.sent();
|
54
|
-
if (!apiOnly)
|
55
|
-
return [
|
56
|
-
3,
|
57
|
-
4
|
58
|
-
];
|
59
|
-
return [
|
60
|
-
4,
|
61
|
-
hookRunners.modifyServerRoutes({
|
62
|
-
routes: []
|
63
|
-
})
|
64
|
-
];
|
65
|
-
case 3:
|
66
|
-
routes = _state.sent().routes;
|
67
|
-
debug("server routes: %o", routes);
|
68
|
-
appContext = _object_spread_props(_object_spread({}, api.useAppContext()), {
|
69
|
-
apiOnly,
|
70
|
-
serverRoutes: routes
|
71
|
-
});
|
72
|
-
api.setAppContext(appContext);
|
73
|
-
return [
|
74
|
-
2
|
75
|
-
];
|
76
|
-
case 4:
|
77
|
-
return [
|
78
|
-
4,
|
79
|
-
Promise.all([
|
80
|
-
import("./getBundleEntry.js"),
|
81
|
-
import("./getServerRoutes.js"),
|
82
|
-
import("./getHtmlTemplate.js")
|
83
|
-
])
|
84
|
-
];
|
85
|
-
case 5:
|
86
|
-
_ref = _sliced_to_array.apply(void 0, [
|
87
|
-
_state.sent(),
|
88
|
-
3
|
89
|
-
]), getBundleEntry = _ref[0].getBundleEntry, getServerRoutes = _ref[1].getServerRoutes, getHtmlTemplate = _ref[2].getHtmlTemplate;
|
90
|
-
_ = hookRunners.modifyEntrypoints;
|
91
|
-
_tmp = {};
|
92
|
-
return [
|
93
|
-
4,
|
94
|
-
getBundleEntry(hookRunners, appContext, resolvedConfig)
|
95
|
-
];
|
96
|
-
case 6:
|
97
|
-
return [
|
98
|
-
4,
|
99
|
-
_.apply(hookRunners, [
|
100
|
-
(_tmp.entrypoints = _state.sent(), _tmp)
|
101
|
-
])
|
102
|
-
];
|
103
|
-
case 7:
|
104
|
-
entrypoints = _state.sent().entrypoints;
|
105
|
-
debug("entrypoints: %o", entrypoints);
|
106
|
-
initialRoutes = getServerRoutes(entrypoints, {
|
107
|
-
appContext,
|
108
|
-
config: resolvedConfig
|
109
229
|
});
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
return point.entryName;
|
230
|
+
});
|
231
|
+
return function(_2) {
|
232
|
+
return _ref2.apply(this, arguments);
|
233
|
+
};
|
234
|
+
}());
|
235
|
+
builder.onAfterBuild(function() {
|
236
|
+
var _ref2 = _async_to_generator(function(param2) {
|
237
|
+
var stats, environments, isFirstCompile, isWatch;
|
238
|
+
return _ts_generator(this, function(_state2) {
|
239
|
+
switch (_state2.label) {
|
240
|
+
case 0:
|
241
|
+
stats = param2.stats, environments = param2.environments, isFirstCompile = param2.isFirstCompile, isWatch = param2.isWatch;
|
242
|
+
return [
|
243
|
+
4,
|
244
|
+
hooks.onAfterBuild.call({
|
245
|
+
stats,
|
246
|
+
environments,
|
247
|
+
isFirstCompile,
|
248
|
+
isWatch
|
249
|
+
})
|
250
|
+
];
|
251
|
+
case 1:
|
252
|
+
_state2.sent();
|
253
|
+
return [
|
254
|
+
4,
|
255
|
+
emitResolvedConfig(appContext.appDirectory, normalizedConfig)
|
256
|
+
];
|
257
|
+
case 2:
|
258
|
+
_state2.sent();
|
259
|
+
return [
|
260
|
+
2
|
261
|
+
];
|
262
|
+
}
|
144
263
|
});
|
145
|
-
|
264
|
+
});
|
265
|
+
return function(_2) {
|
266
|
+
return _ref2.apply(this, arguments);
|
267
|
+
};
|
268
|
+
}());
|
269
|
+
builder.onDevCompileDone(function() {
|
270
|
+
var _ref2 = _async_to_generator(function(param2) {
|
271
|
+
var isFirstCompile;
|
272
|
+
return _ts_generator(this, function(_state2) {
|
273
|
+
isFirstCompile = param2.isFirstCompile;
|
274
|
+
hooks.onAfterDev.call({
|
275
|
+
isFirstCompile
|
276
|
+
});
|
277
|
+
if (isFirstCompile) {
|
278
|
+
printInstructions(hooks, appContext, normalizedConfig);
|
279
|
+
}
|
146
280
|
return [
|
147
|
-
|
148
|
-
11
|
281
|
+
2
|
149
282
|
];
|
150
|
-
entry = minimist(getArgv()).entry;
|
151
|
-
return [
|
152
|
-
4,
|
153
|
-
getSelectedEntries(typeof entry === "string" ? entry.split(",") : entry, entrypoints)
|
154
|
-
];
|
155
|
-
case 10:
|
156
|
-
checkedEntries = _state.sent();
|
157
|
-
_state.label = 11;
|
158
|
-
case 11:
|
159
|
-
appContext = _object_spread_props(_object_spread({}, api.useAppContext()), {
|
160
|
-
entrypoints,
|
161
|
-
checkedEntries,
|
162
|
-
apiOnly,
|
163
|
-
serverRoutes: routes1,
|
164
|
-
htmlTemplates
|
165
283
|
});
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
return [
|
188
|
-
4,
|
189
|
-
createBuilderForModern({
|
190
|
-
normalizedConfig,
|
191
|
-
appContext
|
192
|
-
})
|
193
|
-
];
|
194
|
-
case 14:
|
195
|
-
builder = _state.sent();
|
196
|
-
builder.onBeforeBuild(function() {
|
197
|
-
var _ref2 = _async_to_generator(function(param2) {
|
198
|
-
var bundlerConfigs, isFirstCompile, hookRunners2;
|
199
|
-
return _ts_generator(this, function(_state2) {
|
200
|
-
switch (_state2.label) {
|
201
|
-
case 0:
|
202
|
-
bundlerConfigs = param2.bundlerConfigs, isFirstCompile = param2.isFirstCompile;
|
203
|
-
if (!isFirstCompile) {
|
204
|
-
return [
|
205
|
-
2
|
206
|
-
];
|
207
|
-
}
|
208
|
-
hookRunners2 = api.useHookRunners();
|
209
|
-
return [
|
210
|
-
4,
|
211
|
-
generateRoutes(appContext)
|
212
|
-
];
|
213
|
-
case 1:
|
214
|
-
_state2.sent();
|
215
|
-
return [
|
216
|
-
4,
|
217
|
-
hookRunners2.beforeBuild({
|
218
|
-
bundlerConfigs
|
219
|
-
})
|
220
|
-
];
|
221
|
-
case 2:
|
222
|
-
_state2.sent();
|
223
|
-
return [
|
224
|
-
2
|
225
|
-
];
|
226
|
-
}
|
227
|
-
});
|
228
|
-
});
|
229
|
-
return function(_2) {
|
230
|
-
return _ref2.apply(this, arguments);
|
231
|
-
};
|
232
|
-
}());
|
233
|
-
builder.onAfterBuild(function() {
|
234
|
-
var _ref2 = _async_to_generator(function(param2) {
|
235
|
-
var stats, hookRunners2;
|
236
|
-
return _ts_generator(this, function(_state2) {
|
237
|
-
switch (_state2.label) {
|
238
|
-
case 0:
|
239
|
-
stats = param2.stats;
|
240
|
-
hookRunners2 = api.useHookRunners();
|
241
|
-
return [
|
242
|
-
4,
|
243
|
-
hookRunners2.afterBuild({
|
244
|
-
stats
|
245
|
-
})
|
246
|
-
];
|
247
|
-
case 1:
|
248
|
-
_state2.sent();
|
249
|
-
return [
|
250
|
-
4,
|
251
|
-
emitResolvedConfig(appContext.appDirectory, normalizedConfig)
|
252
|
-
];
|
253
|
-
case 2:
|
254
|
-
_state2.sent();
|
255
|
-
return [
|
256
|
-
2
|
257
|
-
];
|
258
|
-
}
|
259
|
-
});
|
260
|
-
});
|
261
|
-
return function(_2) {
|
262
|
-
return _ref2.apply(this, arguments);
|
263
|
-
};
|
264
|
-
}());
|
265
|
-
builder.onDevCompileDone(function() {
|
266
|
-
var _ref2 = _async_to_generator(function(param2) {
|
267
|
-
var isFirstCompile, hookRunners2;
|
268
|
-
return _ts_generator(this, function(_state2) {
|
269
|
-
isFirstCompile = param2.isFirstCompile;
|
270
|
-
hookRunners2 = api.useHookRunners();
|
271
|
-
hookRunners2.afterDev({
|
272
|
-
isFirstCompile
|
273
|
-
});
|
274
|
-
if (isFirstCompile) {
|
275
|
-
printInstructions(hookRunners2, appContext, normalizedConfig);
|
276
|
-
}
|
284
|
+
});
|
285
|
+
return function(_2) {
|
286
|
+
return _ref2.apply(this, arguments);
|
287
|
+
};
|
288
|
+
}());
|
289
|
+
builder.onBeforeCreateCompiler(function() {
|
290
|
+
var _ref2 = _async_to_generator(function(param2) {
|
291
|
+
var bundlerConfigs, environments;
|
292
|
+
return _ts_generator(this, function(_state2) {
|
293
|
+
switch (_state2.label) {
|
294
|
+
case 0:
|
295
|
+
bundlerConfigs = param2.bundlerConfigs, environments = param2.environments;
|
296
|
+
return [
|
297
|
+
4,
|
298
|
+
hooks.onBeforeCreateCompiler.call({
|
299
|
+
environments,
|
300
|
+
bundlerConfigs
|
301
|
+
})
|
302
|
+
];
|
303
|
+
case 1:
|
304
|
+
_state2.sent();
|
277
305
|
return [
|
278
306
|
2
|
279
307
|
];
|
280
|
-
|
281
|
-
});
|
282
|
-
return function(_2) {
|
283
|
-
return _ref2.apply(this, arguments);
|
284
|
-
};
|
285
|
-
}());
|
286
|
-
builder.onBeforeCreateCompiler(function() {
|
287
|
-
var _ref2 = _async_to_generator(function(param2) {
|
288
|
-
var bundlerConfigs, hookRunners2;
|
289
|
-
return _ts_generator(this, function(_state2) {
|
290
|
-
switch (_state2.label) {
|
291
|
-
case 0:
|
292
|
-
bundlerConfigs = param2.bundlerConfigs;
|
293
|
-
hookRunners2 = api.useHookRunners();
|
294
|
-
return [
|
295
|
-
4,
|
296
|
-
hookRunners2.beforeCreateCompiler({
|
297
|
-
bundlerConfigs
|
298
|
-
})
|
299
|
-
];
|
300
|
-
case 1:
|
301
|
-
_state2.sent();
|
302
|
-
return [
|
303
|
-
2
|
304
|
-
];
|
305
|
-
}
|
306
|
-
});
|
307
|
-
});
|
308
|
-
return function(_2) {
|
309
|
-
return _ref2.apply(this, arguments);
|
310
|
-
};
|
311
|
-
}());
|
312
|
-
builder.onAfterCreateCompiler(function() {
|
313
|
-
var _ref2 = _async_to_generator(function(param2) {
|
314
|
-
var compiler, hookRunners2;
|
315
|
-
return _ts_generator(this, function(_state2) {
|
316
|
-
switch (_state2.label) {
|
317
|
-
case 0:
|
318
|
-
compiler = param2.compiler;
|
319
|
-
hookRunners2 = api.useHookRunners();
|
320
|
-
return [
|
321
|
-
4,
|
322
|
-
hookRunners2.afterCreateCompiler({
|
323
|
-
compiler
|
324
|
-
})
|
325
|
-
];
|
326
|
-
case 1:
|
327
|
-
_state2.sent();
|
328
|
-
return [
|
329
|
-
2
|
330
|
-
];
|
331
|
-
}
|
332
|
-
});
|
333
|
-
});
|
334
|
-
return function(_2) {
|
335
|
-
return _ref2.apply(this, arguments);
|
336
|
-
};
|
337
|
-
}());
|
338
|
-
builder.addPlugins(resolvedConfig.builderPlugins);
|
339
|
-
appContext = _object_spread_props(_object_spread({}, api.useAppContext()), {
|
340
|
-
builder
|
308
|
+
}
|
341
309
|
});
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
310
|
+
});
|
311
|
+
return function(_2) {
|
312
|
+
return _ref2.apply(this, arguments);
|
313
|
+
};
|
314
|
+
}());
|
315
|
+
builder.onAfterCreateCompiler(function() {
|
316
|
+
var _ref2 = _async_to_generator(function(param2) {
|
317
|
+
var compiler, environments;
|
318
|
+
return _ts_generator(this, function(_state2) {
|
319
|
+
switch (_state2.label) {
|
320
|
+
case 0:
|
321
|
+
compiler = param2.compiler, environments = param2.environments;
|
322
|
+
return [
|
323
|
+
4,
|
324
|
+
hooks.onAfterCreateCompiler.call({
|
325
|
+
environments,
|
326
|
+
compiler
|
327
|
+
})
|
328
|
+
];
|
329
|
+
case 1:
|
330
|
+
_state2.sent();
|
331
|
+
return [
|
332
|
+
2
|
333
|
+
];
|
334
|
+
}
|
335
|
+
});
|
336
|
+
});
|
337
|
+
return function(_2) {
|
338
|
+
return _ref2.apply(this, arguments);
|
339
|
+
};
|
340
|
+
}());
|
341
|
+
builder.addPlugins(resolvedConfig.builderPlugins);
|
342
|
+
api.updateAppContext({
|
343
|
+
builder
|
344
|
+
});
|
345
|
+
_state.label = 15;
|
346
|
+
case 15:
|
347
|
+
return [
|
348
|
+
2
|
349
|
+
];
|
350
|
+
}
|
351
|
+
});
|
352
|
+
}));
|
353
|
+
api.addWatchFiles(function() {
|
354
|
+
return {
|
355
|
+
files: pagesDir,
|
356
|
+
isPrivate: true
|
357
|
+
};
|
358
|
+
});
|
359
|
+
api.modifyResolvedConfig(function(resolved) {
|
360
|
+
var appContext = api.getAppContext();
|
361
|
+
var config = initialNormalizedConfig(resolved, appContext, bundler);
|
362
|
+
return config;
|
363
|
+
});
|
367
364
|
}
|
368
365
|
};
|
369
366
|
}
|