@modern-js/app-tools 2.63.0 → 2.63.1

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.
Files changed (61) hide show
  1. package/dist/cjs/commands/dev.js +1 -1
  2. package/dist/cjs/commands/serve.js +1 -1
  3. package/dist/cjs/new/compat/hooks.js +11 -4
  4. package/dist/cjs/new/compat/utils.js +10 -1
  5. package/dist/cjs/new/context.js +0 -1
  6. package/dist/cjs/plugins/analyze/getBundleEntry.js +2 -2
  7. package/dist/cjs/plugins/analyze/getFileSystemEntry.js +9 -9
  8. package/dist/cjs/plugins/analyze/getHtmlTemplate.js +51 -25
  9. package/dist/cjs/plugins/analyze/index.js +128 -130
  10. package/dist/cjs/plugins/deploy/index.js +12 -14
  11. package/dist/cjs/plugins/initialize/index.js +1 -1
  12. package/dist/cjs/utils/printInstructions.js +12 -3
  13. package/dist/cjs/utils/restart.js +2 -1
  14. package/dist/esm/commands/dev.js +2 -2
  15. package/dist/esm/commands/serve.js +2 -2
  16. package/dist/esm/new/compat/hooks.js +27 -17
  17. package/dist/esm/new/compat/utils.js +10 -1
  18. package/dist/esm/new/context.js +0 -1
  19. package/dist/esm/plugins/analyze/getBundleEntry.js +3 -3
  20. package/dist/esm/plugins/analyze/getFileSystemEntry.js +12 -12
  21. package/dist/esm/plugins/analyze/getHtmlTemplate.js +101 -28
  22. package/dist/esm/plugins/analyze/index.js +328 -331
  23. package/dist/esm/plugins/deploy/index.js +84 -88
  24. package/dist/esm/plugins/initialize/index.js +1 -1
  25. package/dist/esm/utils/printInstructions.js +29 -2
  26. package/dist/esm/utils/restart.js +2 -1
  27. package/dist/esm-node/commands/dev.js +2 -2
  28. package/dist/esm-node/commands/serve.js +2 -2
  29. package/dist/esm-node/new/compat/hooks.js +11 -4
  30. package/dist/esm-node/new/compat/utils.js +10 -1
  31. package/dist/esm-node/new/context.js +0 -1
  32. package/dist/esm-node/plugins/analyze/getBundleEntry.js +2 -2
  33. package/dist/esm-node/plugins/analyze/getFileSystemEntry.js +9 -9
  34. package/dist/esm-node/plugins/analyze/getHtmlTemplate.js +49 -24
  35. package/dist/esm-node/plugins/analyze/index.js +128 -130
  36. package/dist/esm-node/plugins/deploy/index.js +12 -14
  37. package/dist/esm-node/plugins/initialize/index.js +1 -1
  38. package/dist/esm-node/utils/printInstructions.js +10 -2
  39. package/dist/esm-node/utils/restart.js +2 -1
  40. package/dist/types/builder/generator/adapterCopy.d.ts +2 -1
  41. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -2
  42. package/dist/types/builder/generator/createCopyPattern.d.ts +4 -3
  43. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +2 -2
  44. package/dist/types/builder/index.d.ts +1 -1
  45. package/dist/types/builder/shared/createCopyInfo.d.ts +3 -2
  46. package/dist/types/builder/shared/types.d.ts +3 -2
  47. package/dist/types/config/initialize/index.d.ts +3 -2
  48. package/dist/types/config/initialize/inits.d.ts +4 -3
  49. package/dist/types/new/context.d.ts +0 -1
  50. package/dist/types/plugins/analyze/getBundleEntry.d.ts +3 -3
  51. package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +3 -3
  52. package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +26 -5
  53. package/dist/types/plugins/analyze/getServerRoutes.d.ts +2 -2
  54. package/dist/types/plugins/analyze/index.d.ts +2 -3
  55. package/dist/types/plugins/deploy/index.d.ts +2 -3
  56. package/dist/types/plugins/deploy/platforms/platform.d.ts +3 -3
  57. package/dist/types/plugins/deploy/utils.d.ts +2 -2
  58. package/dist/types/types/new.d.ts +38 -21
  59. package/dist/types/utils/printInstructions.d.ts +3 -1
  60. package/dist/types/utils/routes.d.ts +2 -1
  61. package/package.json +20 -20
@@ -23,347 +23,344 @@ function analyze_default(param) {
23
23
  setup: function(api) {
24
24
  var pagesDir = [];
25
25
  var nestedRouteEntries = [];
26
- return {
27
- prepare: function prepare() {
28
- return _async_to_generator(function() {
29
- var _resolvedConfig_source, appContext, resolvedConfig, hookRunners, apiOnly, routes, _ref, getBundleEntry, getServerRoutes, getHtmlTemplate, entrypoints, _, _tmp, initialRoutes, routes1, htmlTemplates, checkedEntries, entry, normalizedConfig, createBuilderForModern, builder;
30
- return _ts_generator(this, function(_state) {
31
- switch (_state.label) {
32
- case 0:
33
- appContext = api.useAppContext();
34
- resolvedConfig = api.useResolvedConfigContext();
35
- hookRunners = api.useHookRunners();
36
- try {
37
- if (checkIsBuildCommands()) {
38
- fs.emptydirSync(appContext.internalDirectory);
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
- return [
111
- 4,
112
- hookRunners.modifyServerRoutes({
113
- routes: initialRoutes
114
- })
115
- ];
116
- case 8:
117
- routes1 = _state.sent().routes;
118
- debug("server routes: %o", routes1);
119
- appContext = _object_spread_props(_object_spread({}, api.useAppContext()), {
120
- entrypoints,
121
- serverRoutes: routes1
122
- });
123
- api.setAppContext(appContext);
124
- nestedRouteEntries = entrypoints.map(function(point) {
125
- return point.nestedRoutesEntry;
126
- }).filter(Boolean);
127
- pagesDir = entrypoints.map(function(point) {
128
- return point.entry;
129
- }).filter(function(entry2) {
130
- return entry2 && !path.extname(entry2);
131
- }).concat(nestedRouteEntries);
132
- return [
133
- 4,
134
- getHtmlTemplate(entrypoints, api, {
135
- appContext,
136
- config: resolvedConfig
137
- })
138
- ];
139
- case 9:
140
- htmlTemplates = _state.sent();
141
- debug("html templates: %o", htmlTemplates);
142
- checkedEntries = entrypoints.map(function(point) {
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
- if (!isDevCommand())
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
- 3,
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
- api.setAppContext(appContext);
167
- if (!checkIsBuildCommands())
168
- return [
169
- 3,
170
- 15
171
- ];
172
- return [
173
- 4,
174
- hookRunners.generateEntryCode({
175
- entrypoints
176
- })
177
- ];
178
- case 12:
179
- _state.sent();
180
- normalizedConfig = api.useResolvedConfigContext();
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, 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
- api.setAppContext(appContext);
343
- _state.label = 15;
344
- case 15:
345
- return [
346
- 2
347
- ];
348
- }
349
- });
350
- })();
351
- },
352
- watchFiles: function watchFiles() {
353
- return {
354
- files: pagesDir,
355
- isPrivate: true
356
- };
357
- },
358
- resolvedConfig: function resolvedConfig(param2) {
359
- var resolved = param2.resolved;
360
- var appContext = api.useAppContext();
361
- var config = initialNormalizedConfig(resolved, appContext, bundler);
362
- return {
363
- resolved: config
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
  }