@modern-js/app-tools 2.19.1 → 2.21.0

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 (116) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/bin/modern.js +0 -1
  3. package/dist/cjs/analyze/generateCode.js +22 -48
  4. package/dist/cjs/analyze/getBundleEntry.js +3 -7
  5. package/dist/cjs/analyze/getClientRoutes/getRoutes.js +2 -6
  6. package/dist/cjs/analyze/getClientRoutes/getRoutesLegacy.js +2 -6
  7. package/dist/cjs/analyze/getClientRoutes/utils.js +2 -6
  8. package/dist/cjs/analyze/getFileSystemEntry.js +3 -7
  9. package/dist/cjs/analyze/getHtmlTemplate.js +4 -47
  10. package/dist/cjs/analyze/getServerRoutes.js +5 -7
  11. package/dist/cjs/analyze/index.js +11 -48
  12. package/dist/cjs/analyze/isDefaultExportFunction.js +5 -48
  13. package/dist/cjs/analyze/nestedRoutes.js +2 -41
  14. package/dist/cjs/analyze/templates.js +2 -6
  15. package/dist/cjs/analyze/utils.js +3 -7
  16. package/dist/cjs/builder/builder-rspack/adapterCopy.js +4 -21
  17. package/dist/cjs/builder/builder-webpack/index.js +2 -41
  18. package/dist/cjs/builder/generator/index.js +3 -42
  19. package/dist/cjs/builder/index.js +4 -43
  20. package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +6 -56
  21. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +6 -45
  22. package/dist/cjs/builder/shared/builderPlugins/index.js +4 -16
  23. package/dist/cjs/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +3 -15
  24. package/dist/cjs/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +5 -17
  25. package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +2 -6
  26. package/dist/cjs/builder/shared/bundlerPlugins/index.js +4 -16
  27. package/dist/cjs/builder/shared/createCopyInfo.js +2 -6
  28. package/dist/cjs/builder/shared/index.js +4 -16
  29. package/dist/cjs/commands/index.js +4 -16
  30. package/dist/cjs/commands/serve.js +2 -6
  31. package/dist/cjs/config/index.js +4 -16
  32. package/dist/cjs/config/initialize/inits.js +2 -41
  33. package/dist/cjs/index.js +41 -80
  34. package/dist/cjs/schema/Schema.js +2 -14
  35. package/dist/cjs/schema/index.js +2 -6
  36. package/dist/cjs/types/config/index.js +2 -14
  37. package/dist/cjs/types/index.js +4 -16
  38. package/dist/cjs/utils/config.js +2 -41
  39. package/dist/cjs/utils/generateWatchFiles.js +2 -6
  40. package/dist/cjs/utils/routes.js +2 -6
  41. package/dist/esm/analyze/generateCode.js +13 -170
  42. package/dist/esm/analyze/getBundleEntry.js +1 -1
  43. package/dist/esm/analyze/getClientRoutes/getRoutes.js +2 -52
  44. package/dist/esm/analyze/getClientRoutes/getRoutesLegacy.js +2 -52
  45. package/dist/esm/analyze/getHtmlTemplate.js +6 -151
  46. package/dist/esm/analyze/getServerRoutes.js +6 -118
  47. package/dist/esm/analyze/index.js +19 -251
  48. package/dist/esm/analyze/nestedRoutes.js +5 -184
  49. package/dist/esm/analyze/templates.js +6 -242
  50. package/dist/esm/analyze/utils.js +6 -205
  51. package/dist/esm/builder/builder-rspack/adapterCopy.js +10 -235
  52. package/dist/esm/builder/builder-webpack/adapterModern.js +1 -34
  53. package/dist/esm/builder/builder-webpack/index.js +7 -219
  54. package/dist/esm/builder/generator/createBuilderProviderConfig.js +2 -52
  55. package/dist/esm/builder/generator/index.js +4 -133
  56. package/dist/esm/builder/index.js +3 -132
  57. package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +9 -191
  58. package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +10 -139
  59. package/dist/esm/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +4 -69
  60. package/dist/esm/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +3 -35
  61. package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +7 -226
  62. package/dist/esm/commands/build.js +5 -184
  63. package/dist/esm/commands/deploy.js +3 -132
  64. package/dist/esm/commands/dev.js +6 -185
  65. package/dist/esm/commands/inspect.js +3 -132
  66. package/dist/esm/commands/serve.js +6 -185
  67. package/dist/esm/config/default.js +3 -52
  68. package/dist/esm/config/initialize/inits.js +3 -86
  69. package/dist/esm/defineConfig.js +2 -52
  70. package/dist/esm/index.js +49 -207
  71. package/dist/esm/initialize/index.js +6 -185
  72. package/dist/esm/schema/Schema.js +8 -213
  73. package/dist/esm/schema/index.js +1 -13
  74. package/dist/esm/schema/legacy.js +1 -13
  75. package/dist/esm/utils/config.js +7 -186
  76. package/dist/esm/utils/createServer.js +6 -185
  77. package/dist/esm/utils/generateWatchFiles.js +5 -167
  78. package/dist/esm/utils/getSelectedEntries.js +3 -132
  79. package/dist/esm/utils/getServerInternalPlugins.js +5 -184
  80. package/dist/esm/utils/printInstructions.js +3 -132
  81. package/dist/esm/utils/restart.js +3 -132
  82. package/dist/esm/utils/routes.js +3 -132
  83. package/dist/esm-node/analyze/generateCode.js +19 -2
  84. package/dist/esm-node/analyze/getBundleEntry.js +1 -1
  85. package/dist/esm-node/analyze/getServerRoutes.js +2 -0
  86. package/dist/esm-node/analyze/index.js +4 -2
  87. package/dist/esm-node/builder/builder-rspack/adapterCopy.js +1 -14
  88. package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.js +2 -6
  89. package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +5 -5
  90. package/dist/esm-node/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +1 -13
  91. package/dist/esm-node/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +1 -13
  92. package/dist/esm-node/index.js +22 -6
  93. package/dist/esm-node/schema/Schema.js +1 -13
  94. package/dist/types/analyze/index.d.ts +0 -2
  95. package/dist/types/builder/builder-rspack/index.d.ts +1 -1
  96. package/dist/types/builder/builder-webpack/adapterModern.d.ts +0 -1
  97. package/dist/types/builder/generator/index.d.ts +1 -2
  98. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +0 -1
  99. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +2 -3
  100. package/dist/types/defineConfig.d.ts +0 -1
  101. package/dist/types/index.d.ts +0 -2
  102. package/dist/types/initialize/index.d.ts +0 -2
  103. package/dist/types/types/config/index.d.ts +2 -2
  104. package/dist/types/types/config/output.d.ts +1 -0
  105. package/dist/types/types/config/security.d.ts +2 -0
  106. package/dist/types/types/config/source.d.ts +0 -1
  107. package/dist/types/types/config/tools.d.ts +0 -2
  108. package/dist/types/types/hooks.d.ts +3 -1
  109. package/dist/types/types/legacyConfig/dev.d.ts +0 -1
  110. package/dist/types/types/legacyConfig/output.d.ts +2 -3
  111. package/dist/types/types/legacyConfig/source.d.ts +0 -1
  112. package/dist/types/types/legacyConfig/tools.d.ts +0 -1
  113. package/dist/types/utils/config.d.ts +0 -1
  114. package/dist/types/utils/getSelectedEntries.d.ts +0 -1
  115. package/lib/types.d.ts +8 -8
  116. package/package.json +29 -29
@@ -1,244 +1,8 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length)
3
- len = arr.length;
4
- for (var i = 0, arr2 = new Array(len); i < len; i++)
5
- arr2[i] = arr[i];
6
- return arr2;
7
- }
8
- function _array_with_holes(arr) {
9
- if (Array.isArray(arr))
10
- return arr;
11
- }
12
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
- try {
14
- var info = gen[key](arg);
15
- var value = info.value;
16
- } catch (error) {
17
- reject(error);
18
- return;
19
- }
20
- if (info.done) {
21
- resolve(value);
22
- } else {
23
- Promise.resolve(value).then(_next, _throw);
24
- }
25
- }
26
- function _async_to_generator(fn) {
27
- return function() {
28
- var self = this, args = arguments;
29
- return new Promise(function(resolve, reject) {
30
- var gen = fn.apply(self, args);
31
- function _next(value) {
32
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
33
- }
34
- function _throw(err) {
35
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
36
- }
37
- _next(void 0);
38
- });
39
- };
40
- }
41
- function _define_property(obj, key, value) {
42
- if (key in obj) {
43
- Object.defineProperty(obj, key, {
44
- value: value,
45
- enumerable: true,
46
- configurable: true,
47
- writable: true
48
- });
49
- } else {
50
- obj[key] = value;
51
- }
52
- return obj;
53
- }
54
- function _iterable_to_array_limit(arr, i) {
55
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
56
- if (_i == null)
57
- return;
58
- var _arr = [];
59
- var _n = true;
60
- var _d = false;
61
- var _s, _e;
62
- try {
63
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
64
- _arr.push(_s.value);
65
- if (i && _arr.length === i)
66
- break;
67
- }
68
- } catch (err) {
69
- _d = true;
70
- _e = err;
71
- } finally {
72
- try {
73
- if (!_n && _i["return"] != null)
74
- _i["return"]();
75
- } finally {
76
- if (_d)
77
- throw _e;
78
- }
79
- }
80
- return _arr;
81
- }
82
- function _non_iterable_rest() {
83
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
84
- }
85
- function _object_spread(target) {
86
- for (var i = 1; i < arguments.length; i++) {
87
- var source = arguments[i] != null ? arguments[i] : {};
88
- var ownKeys2 = Object.keys(source);
89
- if (typeof Object.getOwnPropertySymbols === "function") {
90
- ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
91
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
92
- }));
93
- }
94
- ownKeys2.forEach(function(key) {
95
- _define_property(target, key, source[key]);
96
- });
97
- }
98
- return target;
99
- }
100
- function ownKeys(object, enumerableOnly) {
101
- var keys = Object.keys(object);
102
- if (Object.getOwnPropertySymbols) {
103
- var symbols = Object.getOwnPropertySymbols(object);
104
- if (enumerableOnly) {
105
- symbols = symbols.filter(function(sym) {
106
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
107
- });
108
- }
109
- keys.push.apply(keys, symbols);
110
- }
111
- return keys;
112
- }
113
- function _object_spread_props(target, source) {
114
- source = source != null ? source : {};
115
- if (Object.getOwnPropertyDescriptors) {
116
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
117
- } else {
118
- ownKeys(Object(source)).forEach(function(key) {
119
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
120
- });
121
- }
122
- return target;
123
- }
124
- function _sliced_to_array(arr, i) {
125
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
126
- }
127
- function _unsupported_iterable_to_array(o, minLen) {
128
- if (!o)
129
- return;
130
- if (typeof o === "string")
131
- return _array_like_to_array(o, minLen);
132
- var n = Object.prototype.toString.call(o).slice(8, -1);
133
- if (n === "Object" && o.constructor)
134
- n = o.constructor.name;
135
- if (n === "Map" || n === "Set")
136
- return Array.from(n);
137
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
138
- return _array_like_to_array(o, minLen);
139
- }
140
- var __generator = function(thisArg, body) {
141
- var f, y, t, g, _ = {
142
- label: 0,
143
- sent: function() {
144
- if (t[0] & 1)
145
- throw t[1];
146
- return t[1];
147
- },
148
- trys: [],
149
- ops: []
150
- };
151
- return g = {
152
- next: verb(0),
153
- "throw": verb(1),
154
- "return": verb(2)
155
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
156
- return this;
157
- }), g;
158
- function verb(n) {
159
- return function(v) {
160
- return step([
161
- n,
162
- v
163
- ]);
164
- };
165
- }
166
- function step(op) {
167
- if (f)
168
- throw new TypeError("Generator is already executing.");
169
- while (_)
170
- try {
171
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
172
- return t;
173
- if (y = 0, t)
174
- op = [
175
- op[0] & 2,
176
- t.value
177
- ];
178
- switch (op[0]) {
179
- case 0:
180
- case 1:
181
- t = op;
182
- break;
183
- case 4:
184
- _.label++;
185
- return {
186
- value: op[1],
187
- done: false
188
- };
189
- case 5:
190
- _.label++;
191
- y = op[1];
192
- op = [
193
- 0
194
- ];
195
- continue;
196
- case 7:
197
- op = _.ops.pop();
198
- _.trys.pop();
199
- continue;
200
- default:
201
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
202
- _ = 0;
203
- continue;
204
- }
205
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
206
- _.label = op[1];
207
- break;
208
- }
209
- if (op[0] === 6 && _.label < t[1]) {
210
- _.label = t[1];
211
- t = op;
212
- break;
213
- }
214
- if (t && _.label < t[2]) {
215
- _.label = t[2];
216
- _.ops.push(op);
217
- break;
218
- }
219
- if (t[2])
220
- _.ops.pop();
221
- _.trys.pop();
222
- continue;
223
- }
224
- op = body.call(thisArg, _);
225
- } catch (e) {
226
- op = [
227
- 6,
228
- e
229
- ];
230
- y = 0;
231
- } finally {
232
- f = t = 0;
233
- }
234
- if (op[0] & 5)
235
- throw op[1];
236
- return {
237
- value: op[0] ? op[1] : void 0,
238
- done: true
239
- };
240
- }
241
- };
1
+ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
4
+ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
5
+ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
242
6
  import path from "path";
243
7
  import { fs, getEntryOptions, isSSGEntry, slash } from "@modern-js/utils";
244
8
  import { APP_CONFIG_NAME, TEMP_LOADERS_DIR } from "./constants";
@@ -321,7 +85,7 @@ var createMatchReg = function(keyword) {
321
85
  export var fileSystemRoutes = function() {
322
86
  var _ref = _async_to_generator(function(param) {
323
87
  var routes, ssrMode, nestedRoutesEntry, entryName, internalDirectory, _param_splitRouteChunks, splitRouteChunks, components, loadings, errors, loaders, loadersMap, configs, configsMap, loadersMapFile, importLazyCode, rootLayoutCode, getDataLoaderPath, traverseRouteTree, routeComponentsCode, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, route, newRoute, routeStr, keywords, regs, newRouteStr, component, finalRoute, keywords1, routeStr1, regs1, newRouteStr1, importLoadingCode, importComponentsCode, importErrorComponentsCode, importLoadersCode, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _step_value, key, loaderInfo, importConfigsCode, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value1, key1, configPath;
324
- return __generator(this, function(_state) {
88
+ return _ts_generator(this, function(_state) {
325
89
  switch (_state.label) {
326
90
  case 0:
327
91
  routes = param.routes, ssrMode = param.ssrMode, nestedRoutesEntry = param.nestedRoutesEntry, entryName = param.entryName, internalDirectory = param.internalDirectory, _param_splitRouteChunks = param.splitRouteChunks, splitRouteChunks = _param_splitRouteChunks === void 0 ? true : _param_splitRouteChunks;
@@ -1,206 +1,7 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length)
3
- len = arr.length;
4
- for (var i = 0, arr2 = new Array(len); i < len; i++)
5
- arr2[i] = arr[i];
6
- return arr2;
7
- }
8
- function _array_with_holes(arr) {
9
- if (Array.isArray(arr))
10
- return arr;
11
- }
12
- function _array_without_holes(arr) {
13
- if (Array.isArray(arr))
14
- return _array_like_to_array(arr);
15
- }
16
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17
- try {
18
- var info = gen[key](arg);
19
- var value = info.value;
20
- } catch (error) {
21
- reject(error);
22
- return;
23
- }
24
- if (info.done) {
25
- resolve(value);
26
- } else {
27
- Promise.resolve(value).then(_next, _throw);
28
- }
29
- }
30
- function _async_to_generator(fn) {
31
- return function() {
32
- var self = this, args = arguments;
33
- return new Promise(function(resolve, reject) {
34
- var gen = fn.apply(self, args);
35
- function _next(value) {
36
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
37
- }
38
- function _throw(err) {
39
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
40
- }
41
- _next(void 0);
42
- });
43
- };
44
- }
45
- function _iterable_to_array(iter) {
46
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
47
- return Array.from(iter);
48
- }
49
- function _iterable_to_array_limit(arr, i) {
50
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
51
- if (_i == null)
52
- return;
53
- var _arr = [];
54
- var _n = true;
55
- var _d = false;
56
- var _s, _e;
57
- try {
58
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
59
- _arr.push(_s.value);
60
- if (i && _arr.length === i)
61
- break;
62
- }
63
- } catch (err) {
64
- _d = true;
65
- _e = err;
66
- } finally {
67
- try {
68
- if (!_n && _i["return"] != null)
69
- _i["return"]();
70
- } finally {
71
- if (_d)
72
- throw _e;
73
- }
74
- }
75
- return _arr;
76
- }
77
- function _non_iterable_rest() {
78
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
79
- }
80
- function _non_iterable_spread() {
81
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
82
- }
83
- function _sliced_to_array(arr, i) {
84
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
85
- }
86
- function _to_consumable_array(arr) {
87
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
88
- }
89
- function _unsupported_iterable_to_array(o, minLen) {
90
- if (!o)
91
- return;
92
- if (typeof o === "string")
93
- return _array_like_to_array(o, minLen);
94
- var n = Object.prototype.toString.call(o).slice(8, -1);
95
- if (n === "Object" && o.constructor)
96
- n = o.constructor.name;
97
- if (n === "Map" || n === "Set")
98
- return Array.from(n);
99
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
100
- return _array_like_to_array(o, minLen);
101
- }
102
- var __generator = function(thisArg, body) {
103
- var f, y, t, g, _ = {
104
- label: 0,
105
- sent: function() {
106
- if (t[0] & 1)
107
- throw t[1];
108
- return t[1];
109
- },
110
- trys: [],
111
- ops: []
112
- };
113
- return g = {
114
- next: verb(0),
115
- "throw": verb(1),
116
- "return": verb(2)
117
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
118
- return this;
119
- }), g;
120
- function verb(n) {
121
- return function(v) {
122
- return step([
123
- n,
124
- v
125
- ]);
126
- };
127
- }
128
- function step(op) {
129
- if (f)
130
- throw new TypeError("Generator is already executing.");
131
- while (_)
132
- try {
133
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
134
- return t;
135
- if (y = 0, t)
136
- op = [
137
- op[0] & 2,
138
- t.value
139
- ];
140
- switch (op[0]) {
141
- case 0:
142
- case 1:
143
- t = op;
144
- break;
145
- case 4:
146
- _.label++;
147
- return {
148
- value: op[1],
149
- done: false
150
- };
151
- case 5:
152
- _.label++;
153
- y = op[1];
154
- op = [
155
- 0
156
- ];
157
- continue;
158
- case 7:
159
- op = _.ops.pop();
160
- _.trys.pop();
161
- continue;
162
- default:
163
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
164
- _ = 0;
165
- continue;
166
- }
167
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
168
- _.label = op[1];
169
- break;
170
- }
171
- if (op[0] === 6 && _.label < t[1]) {
172
- _.label = t[1];
173
- t = op;
174
- break;
175
- }
176
- if (t && _.label < t[2]) {
177
- _.label = t[2];
178
- _.ops.push(op);
179
- break;
180
- }
181
- if (t[2])
182
- _.ops.pop();
183
- _.trys.pop();
184
- continue;
185
- }
186
- op = body.call(thisArg, _);
187
- } catch (e) {
188
- op = [
189
- 6,
190
- e
191
- ];
192
- y = 0;
193
- } finally {
194
- f = t = 0;
195
- }
196
- if (op[0] & 5)
197
- throw op[1];
198
- return {
199
- value: op[0] ? op[1] : void 0,
200
- done: true
201
- };
202
- }
203
- };
1
+ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
+ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
3
+ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
4
+ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
204
5
  import fs from "fs";
205
6
  import path from "path";
206
7
  import { isReact18, normalizeToPosixPath, fs as fse } from "@modern-js/utils";
@@ -317,7 +118,7 @@ export var replaceWithAlias = function(base, filePath, alias) {
317
118
  export var parseModule = function() {
318
119
  var _ref = _async_to_generator(function(param) {
319
120
  var source, filename, content, result;
320
- return __generator(this, function(_state) {
121
+ return _ts_generator(this, function(_state) {
321
122
  switch (_state.label) {
322
123
  case 0:
323
124
  source = param.source, filename = param.filename;
@@ -360,7 +161,7 @@ export var parseModule = function() {
360
161
  export var hasLoader = function() {
361
162
  var _ref = _async_to_generator(function(filename) {
362
163
  var source, _ref2, moduleExports;
363
- return __generator(this, function(_state) {
164
+ return _ts_generator(this, function(_state) {
364
165
  switch (_state.label) {
365
166
  case 0:
366
167
  return [