@doracli/rollup 0.0.3 → 0.0.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/lib/cjs/index.js CHANGED
@@ -20,7 +20,8 @@ var postcss = require('rollup-plugin-postcss');
20
20
  var resolve = require('@rollup/plugin-node-resolve');
21
21
  var presetBabel = require('@doracli/preset-babel');
22
22
 
23
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
23
+ var _documentCurrentScript =
24
+ typeof document !== 'undefined' ? document.currentScript : null;
24
25
  function _arrayLikeToArray(r, a) {
25
26
  (null == a || a > r.length) && (a = r.length);
26
27
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -33,7 +34,10 @@ function _arrayWithoutHoles(r) {
33
34
  if (Array.isArray(r)) return _arrayLikeToArray(r);
34
35
  }
35
36
  function _assertThisInitialized(e) {
36
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
37
+ if (void 0 === e)
38
+ throw new ReferenceError(
39
+ "this hasn't been initialised - super() hasn't been called"
40
+ );
37
41
  return e;
38
42
  }
39
43
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
@@ -52,70 +56,108 @@ function _asyncToGenerator(n) {
52
56
  return new Promise(function (r, o) {
53
57
  var a = n.apply(t, e);
54
58
  function _next(n) {
55
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
59
+ asyncGeneratorStep(a, r, o, _next, _throw, 'next', n);
56
60
  }
57
61
  function _throw(n) {
58
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
62
+ asyncGeneratorStep(a, r, o, _next, _throw, 'throw', n);
59
63
  }
60
64
  _next(void 0);
61
65
  });
62
66
  };
63
67
  }
64
68
  function _callSuper(t, o, e) {
65
- return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
69
+ return (
70
+ (o = _getPrototypeOf(o)),
71
+ _possibleConstructorReturn(
72
+ t,
73
+ _isNativeReflectConstruct()
74
+ ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor)
75
+ : o.apply(t, e)
76
+ )
77
+ );
66
78
  }
67
79
  function _classCallCheck(a, n) {
68
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
80
+ if (!(a instanceof n))
81
+ throw new TypeError('Cannot call a class as a function');
69
82
  }
70
83
  function _defineProperties(e, r) {
71
84
  for (var t = 0; t < r.length; t++) {
72
85
  var o = r[t];
73
- o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
86
+ ((o.enumerable = o.enumerable || false),
87
+ (o.configurable = true),
88
+ 'value' in o && (o.writable = true),
89
+ Object.defineProperty(e, _toPropertyKey(o.key), o));
74
90
  }
75
91
  }
76
92
  function _createClass(e, r, t) {
77
- return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
78
- writable: false
79
- }), e;
93
+ return (
94
+ r && _defineProperties(e.prototype, r),
95
+ Object.defineProperty(e, 'prototype', {
96
+ writable: false,
97
+ }),
98
+ e
99
+ );
80
100
  }
81
101
  function _defineProperty(e, r, t) {
82
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
83
- value: t,
84
- enumerable: true,
85
- configurable: true,
86
- writable: true
87
- }) : e[r] = t, e;
102
+ return (
103
+ (r = _toPropertyKey(r)) in e
104
+ ? Object.defineProperty(e, r, {
105
+ value: t,
106
+ enumerable: true,
107
+ configurable: true,
108
+ writable: true,
109
+ })
110
+ : (e[r] = t),
111
+ e
112
+ );
88
113
  }
89
114
  function _getPrototypeOf(t) {
90
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
91
- return t.__proto__ || Object.getPrototypeOf(t);
92
- }, _getPrototypeOf(t);
115
+ return (
116
+ (_getPrototypeOf = Object.setPrototypeOf
117
+ ? Object.getPrototypeOf.bind()
118
+ : function (t) {
119
+ return t.__proto__ || Object.getPrototypeOf(t);
120
+ }),
121
+ _getPrototypeOf(t)
122
+ );
93
123
  }
94
124
  function _inherits(t, e) {
95
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
96
- t.prototype = Object.create(e && e.prototype, {
125
+ if ('function' != typeof e && null !== e)
126
+ throw new TypeError('Super expression must either be null or a function');
127
+ ((t.prototype = Object.create(e && e.prototype, {
97
128
  constructor: {
98
129
  value: t,
99
130
  writable: true,
100
- configurable: true
101
- }
102
- }), Object.defineProperty(t, "prototype", {
103
- writable: false
104
- }), e && _setPrototypeOf(t, e);
131
+ configurable: true,
132
+ },
133
+ })),
134
+ Object.defineProperty(t, 'prototype', {
135
+ writable: false,
136
+ }),
137
+ e && _setPrototypeOf(t, e));
105
138
  }
106
139
  function _isNativeReflectConstruct() {
107
140
  try {
108
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
141
+ var t = !Boolean.prototype.valueOf.call(
142
+ Reflect.construct(Boolean, [], function () {})
143
+ );
109
144
  } catch (t) {}
110
145
  return (_isNativeReflectConstruct = function () {
111
146
  return !!t;
112
147
  })();
113
148
  }
114
149
  function _iterableToArray(r) {
115
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
150
+ if (
151
+ ('undefined' != typeof Symbol && null != r[Symbol.iterator]) ||
152
+ null != r['@@iterator']
153
+ )
154
+ return Array.from(r);
116
155
  }
117
156
  function _iterableToArrayLimit(r, l) {
118
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
157
+ var t =
158
+ null == r
159
+ ? null
160
+ : ('undefined' != typeof Symbol && r[Symbol.iterator]) || r['@@iterator'];
119
161
  if (null != t) {
120
162
  var e,
121
163
  n,
@@ -125,12 +167,19 @@ function _iterableToArrayLimit(r, l) {
125
167
  f = true,
126
168
  o = false;
127
169
  try {
128
- if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
170
+ if (((i = (t = t.call(r)).next), 0 === l));
171
+ else
172
+ for (
173
+ ;
174
+ !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l);
175
+ f = !0
176
+ );
129
177
  } catch (r) {
130
- o = true, n = r;
178
+ ((o = true), (n = r));
131
179
  } finally {
132
180
  try {
133
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
181
+ if (!f && null != t.return && ((u = t.return()), Object(u) !== u))
182
+ return;
134
183
  } finally {
135
184
  if (o) throw n;
136
185
  }
@@ -139,29 +188,39 @@ function _iterableToArrayLimit(r, l) {
139
188
  }
140
189
  }
141
190
  function _nonIterableRest() {
142
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
191
+ throw new TypeError(
192
+ 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
193
+ );
143
194
  }
144
195
  function _nonIterableSpread() {
145
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
196
+ throw new TypeError(
197
+ 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
198
+ );
146
199
  }
147
200
  function ownKeys(e, r) {
148
201
  var t = Object.keys(e);
149
202
  if (Object.getOwnPropertySymbols) {
150
203
  var o = Object.getOwnPropertySymbols(e);
151
- r && (o = o.filter(function (r) {
152
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
153
- })), t.push.apply(t, o);
204
+ (r &&
205
+ (o = o.filter(function (r) {
206
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
207
+ })),
208
+ t.push.apply(t, o));
154
209
  }
155
210
  return t;
156
211
  }
157
212
  function _objectSpread2(e) {
158
213
  for (var r = 1; r < arguments.length; r++) {
159
214
  var t = null != arguments[r] ? arguments[r] : {};
160
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
161
- _defineProperty(e, r, t[r]);
162
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
163
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
164
- });
215
+ r % 2
216
+ ? ownKeys(Object(t), true).forEach(function (r) {
217
+ _defineProperty(e, r, t[r]);
218
+ })
219
+ : Object.getOwnPropertyDescriptors
220
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t))
221
+ : ownKeys(Object(t)).forEach(function (r) {
222
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
223
+ });
165
224
  }
166
225
  return e;
167
226
  }
@@ -172,162 +231,258 @@ function _objectWithoutProperties(e, t) {
172
231
  i = _objectWithoutPropertiesLoose(e, t);
173
232
  if (Object.getOwnPropertySymbols) {
174
233
  var n = Object.getOwnPropertySymbols(e);
175
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
234
+ for (r = 0; r < n.length; r++)
235
+ ((o = n[r]),
236
+ -1 === t.indexOf(o) &&
237
+ {}.propertyIsEnumerable.call(e, o) &&
238
+ (i[o] = e[o]));
176
239
  }
177
240
  return i;
178
241
  }
179
242
  function _objectWithoutPropertiesLoose(r, e) {
180
243
  if (null == r) return {};
181
244
  var t = {};
182
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
183
- if (-1 !== e.indexOf(n)) continue;
184
- t[n] = r[n];
185
- }
245
+ for (var n in r)
246
+ if ({}.hasOwnProperty.call(r, n)) {
247
+ if (-1 !== e.indexOf(n)) continue;
248
+ t[n] = r[n];
249
+ }
186
250
  return t;
187
251
  }
188
252
  function _possibleConstructorReturn(t, e) {
189
- if (e && ("object" == typeof e || "function" == typeof e)) return e;
190
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
253
+ if (e && ('object' == typeof e || 'function' == typeof e)) return e;
254
+ if (void 0 !== e)
255
+ throw new TypeError(
256
+ 'Derived constructors may only return object or undefined'
257
+ );
191
258
  return _assertThisInitialized(t);
192
259
  }
193
260
  function _regenerator() {
194
261
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
195
262
  var e,
196
263
  t,
197
- r = "function" == typeof Symbol ? Symbol : {},
198
- n = r.iterator || "@@iterator",
199
- o = r.toStringTag || "@@toStringTag";
264
+ r = 'function' == typeof Symbol ? Symbol : {},
265
+ n = r.iterator || '@@iterator',
266
+ o = r.toStringTag || '@@toStringTag';
200
267
  function i(r, n, o, i) {
201
268
  var c = n && n.prototype instanceof Generator ? n : Generator,
202
269
  u = Object.create(c.prototype);
203
- return _regeneratorDefine(u, "_invoke", function (r, n, o) {
204
- var i,
205
- c,
270
+ return (
271
+ _regeneratorDefine(
206
272
  u,
207
- f = 0,
208
- p = o || [],
209
- y = false,
210
- G = {
211
- p: 0,
212
- n: 0,
213
- v: e,
214
- a: d,
215
- f: d.bind(e, 4),
216
- d: function (t, r) {
217
- return i = t, c = 0, u = e, G.n = r, a;
273
+ '_invoke',
274
+ (function (r, n, o) {
275
+ var i,
276
+ c,
277
+ u,
278
+ f = 0,
279
+ p = o || [],
280
+ y = false,
281
+ G = {
282
+ p: 0,
283
+ n: 0,
284
+ v: e,
285
+ a: d,
286
+ f: d.bind(e, 4),
287
+ d: function (t, r) {
288
+ return ((i = t), (c = 0), (u = e), (G.n = r), a);
289
+ },
290
+ };
291
+ function d(r, n) {
292
+ for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
293
+ var o,
294
+ i = p[t],
295
+ d = G.p,
296
+ l = i[2];
297
+ r > 3
298
+ ? (o = l === n) &&
299
+ ((u = i[(c = i[4]) ? 5 : ((c = 3), 3)]), (i[4] = i[5] = e))
300
+ : i[0] <= d &&
301
+ ((o = r < 2 && d < i[1])
302
+ ? ((c = 0), (G.v = n), (G.n = i[1]))
303
+ : d < l &&
304
+ (o = r < 3 || i[0] > n || n > l) &&
305
+ ((i[4] = r), (i[5] = n), (G.n = l), (c = 0)));
306
+ }
307
+ if (o || r > 1) return a;
308
+ throw ((y = true), n);
218
309
  }
219
- };
220
- function d(r, n) {
221
- for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
222
- var o,
223
- i = p[t],
224
- d = G.p,
225
- l = i[2];
226
- r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
227
- }
228
- if (o || r > 1) return a;
229
- throw y = true, n;
230
- }
231
- return function (o, p, l) {
232
- if (f > 1) throw TypeError("Generator is already running");
233
- for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
234
- i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
235
- try {
236
- if (f = 2, i) {
237
- if (c || (o = "next"), t = i[o]) {
238
- if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
239
- if (!t.done) return t;
240
- u = t.value, c < 2 && (c = 0);
241
- } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
242
- i = e;
243
- } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
244
- } catch (t) {
245
- i = e, c = 1, u = t;
246
- } finally {
247
- f = 1;
248
- }
249
- }
250
- return {
251
- value: t,
252
- done: y
253
- };
254
- };
255
- }(r, o, i), true), u;
310
+ return function (o, p, l) {
311
+ if (f > 1) throw TypeError('Generator is already running');
312
+ for (
313
+ y && 1 === p && d(p, l), c = p, u = l;
314
+ (t = c < 2 ? e : u) || !y;
315
+
316
+ ) {
317
+ i ||
318
+ (c
319
+ ? c < 3
320
+ ? (c > 1 && (G.n = -1), d(c, u))
321
+ : (G.n = u)
322
+ : (G.v = u));
323
+ try {
324
+ if (((f = 2), i)) {
325
+ if ((c || (o = 'next'), (t = i[o]))) {
326
+ if (!(t = t.call(i, u)))
327
+ throw TypeError('iterator result is not an object');
328
+ if (!t.done) return t;
329
+ ((u = t.value), c < 2 && (c = 0));
330
+ } else
331
+ (1 === c && (t = i.return) && t.call(i),
332
+ c < 2 &&
333
+ ((u = TypeError(
334
+ "The iterator does not provide a '" + o + "' method"
335
+ )),
336
+ (c = 1)));
337
+ i = e;
338
+ } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
339
+ } catch (t) {
340
+ ((i = e), (c = 1), (u = t));
341
+ } finally {
342
+ f = 1;
343
+ }
344
+ }
345
+ return {
346
+ value: t,
347
+ done: y,
348
+ };
349
+ };
350
+ })(r, o, i),
351
+ true
352
+ ),
353
+ u
354
+ );
256
355
  }
257
356
  var a = {};
258
357
  function Generator() {}
259
358
  function GeneratorFunction() {}
260
359
  function GeneratorFunctionPrototype() {}
261
360
  t = Object.getPrototypeOf;
262
- var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
263
- return this;
264
- }), t),
265
- u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
361
+ var c = [][n]
362
+ ? t(t([][n]()))
363
+ : (_regeneratorDefine((t = {}), n, function () {
364
+ return this;
365
+ }),
366
+ t),
367
+ u =
368
+ (GeneratorFunctionPrototype.prototype =
369
+ Generator.prototype =
370
+ Object.create(c));
266
371
  function f(e) {
267
- return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
372
+ return (
373
+ Object.setPrototypeOf
374
+ ? Object.setPrototypeOf(e, GeneratorFunctionPrototype)
375
+ : ((e.__proto__ = GeneratorFunctionPrototype),
376
+ _regeneratorDefine(e, o, 'GeneratorFunction')),
377
+ (e.prototype = Object.create(u)),
378
+ e
379
+ );
268
380
  }
269
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
270
- return this;
271
- }), _regeneratorDefine(u, "toString", function () {
272
- return "[object Generator]";
273
- }), (_regenerator = function () {
274
- return {
275
- w: i,
276
- m: f
277
- };
278
- })();
381
+ return (
382
+ (GeneratorFunction.prototype = GeneratorFunctionPrototype),
383
+ _regeneratorDefine(u, 'constructor', GeneratorFunctionPrototype),
384
+ _regeneratorDefine(
385
+ GeneratorFunctionPrototype,
386
+ 'constructor',
387
+ GeneratorFunction
388
+ ),
389
+ (GeneratorFunction.displayName = 'GeneratorFunction'),
390
+ _regeneratorDefine(GeneratorFunctionPrototype, o, 'GeneratorFunction'),
391
+ _regeneratorDefine(u),
392
+ _regeneratorDefine(u, o, 'Generator'),
393
+ _regeneratorDefine(u, n, function () {
394
+ return this;
395
+ }),
396
+ _regeneratorDefine(u, 'toString', function () {
397
+ return '[object Generator]';
398
+ }),
399
+ (_regenerator = function () {
400
+ return {
401
+ w: i,
402
+ m: f,
403
+ };
404
+ })()
405
+ );
279
406
  }
280
407
  function _regeneratorDefine(e, r, n, t) {
281
408
  var i = Object.defineProperty;
282
409
  try {
283
- i({}, "", {});
410
+ i({}, '', {});
284
411
  } catch (e) {
285
412
  i = 0;
286
413
  }
287
- _regeneratorDefine = function (e, r, n, t) {
414
+ ((_regeneratorDefine = function (e, r, n, t) {
288
415
  function o(r, n) {
289
416
  _regeneratorDefine(e, r, function (e) {
290
417
  return this._invoke(r, n, e);
291
418
  });
292
419
  }
293
- r ? i ? i(e, r, {
294
- value: n,
295
- enumerable: !t,
296
- configurable: !t,
297
- writable: !t
298
- }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
299
- }, _regeneratorDefine(e, r, n, t);
420
+ r
421
+ ? i
422
+ ? i(e, r, {
423
+ value: n,
424
+ enumerable: !t,
425
+ configurable: !t,
426
+ writable: !t,
427
+ })
428
+ : (e[r] = n)
429
+ : (o('next', 0), o('throw', 1), o('return', 2));
430
+ }),
431
+ _regeneratorDefine(e, r, n, t));
300
432
  }
301
433
  function _setPrototypeOf(t, e) {
302
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
303
- return t.__proto__ = e, t;
304
- }, _setPrototypeOf(t, e);
434
+ return (
435
+ (_setPrototypeOf = Object.setPrototypeOf
436
+ ? Object.setPrototypeOf.bind()
437
+ : function (t, e) {
438
+ return ((t.__proto__ = e), t);
439
+ }),
440
+ _setPrototypeOf(t, e)
441
+ );
305
442
  }
306
443
  function _slicedToArray(r, e) {
307
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
444
+ return (
445
+ _arrayWithHoles(r) ||
446
+ _iterableToArrayLimit(r, e) ||
447
+ _unsupportedIterableToArray(r, e) ||
448
+ _nonIterableRest()
449
+ );
308
450
  }
309
451
  function _toConsumableArray(r) {
310
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
452
+ return (
453
+ _arrayWithoutHoles(r) ||
454
+ _iterableToArray(r) ||
455
+ _unsupportedIterableToArray(r) ||
456
+ _nonIterableSpread()
457
+ );
311
458
  }
312
459
  function _toPrimitive(t, r) {
313
- if ("object" != typeof t || !t) return t;
460
+ if ('object' != typeof t || !t) return t;
314
461
  var e = t[Symbol.toPrimitive];
315
462
  if (void 0 !== e) {
316
463
  var i = e.call(t, r);
317
- if ("object" != typeof i) return i;
318
- throw new TypeError("@@toPrimitive must return a primitive value.");
464
+ if ('object' != typeof i) return i;
465
+ throw new TypeError('@@toPrimitive must return a primitive value.');
319
466
  }
320
- return ("string" === r ? String : Number)(t);
467
+ return ('string' === r ? String : Number)(t);
321
468
  }
322
469
  function _toPropertyKey(t) {
323
- var i = _toPrimitive(t, "string");
324
- return "symbol" == typeof i ? i : i + "";
470
+ var i = _toPrimitive(t, 'string');
471
+ return 'symbol' == typeof i ? i : i + '';
325
472
  }
326
473
  function _unsupportedIterableToArray(r, a) {
327
474
  if (r) {
328
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
475
+ if ('string' == typeof r) return _arrayLikeToArray(r, a);
329
476
  var t = {}.toString.call(r).slice(8, -1);
330
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
477
+ return (
478
+ 'Object' === t && r.constructor && (t = r.constructor.name),
479
+ 'Map' === t || 'Set' === t
480
+ ? Array.from(r)
481
+ : 'Arguments' === t ||
482
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
483
+ ? _arrayLikeToArray(r, a)
484
+ : void 0
485
+ );
331
486
  }
332
487
  }
333
488
 
@@ -337,216 +492,293 @@ var mergeRollupOptions = function mergeRollupOptions(first, second) {
337
492
  return _objectSpread2(_objectSpread2({}, first), second);
338
493
  };
339
494
 
340
- var Compiler = /*#__PURE__*/function (_CompilerBase) {
495
+ var Compiler = /*#__PURE__*/ (function (_CompilerBase) {
341
496
  function Compiler() {
342
497
  var _this;
343
498
  _classCallCheck(this, Compiler);
344
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
499
+ for (
500
+ var _len = arguments.length, args = new Array(_len), _key = 0;
501
+ _key < _len;
502
+ _key++
503
+ ) {
345
504
  args[_key] = arguments[_key];
346
505
  }
347
506
  _this = _callSuper(this, Compiler, [].concat(args));
348
- _defineProperty(_this, "context", /*#__PURE__*/function () {
349
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
350
- var rollupBuild, outputList;
351
- return _regenerator().w(function (_context3) {
352
- while (1) switch (_context3.n) {
353
- case 0:
354
- _context3.n = 1;
355
- return rollup.rollup(mergeRollupOptions(_this.initOptions, options));
356
- case 1:
357
- rollupBuild = _context3.v;
358
- outputList = [];
359
- if (options.output) {
360
- outputList = lang.isArray(options.output) ? options.output : [options.output];
361
- }
362
- return _context3.a(2, Promise.resolve({
363
- rebuild: function () {
364
- var _rebuild = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
365
- var outputOptions, i, output, writeRes;
366
- return _regenerator().w(function (_context) {
367
- while (1) switch (_context.n) {
368
- case 0:
369
- outputOptions = [];
370
- i = 0;
371
- case 1:
372
- if (!(i < outputList.length)) {
373
- _context.n = 4;
374
- break;
507
+ _defineProperty(
508
+ _this,
509
+ 'context',
510
+ /*#__PURE__*/ (function () {
511
+ var _ref = _asyncToGenerator(
512
+ /*#__PURE__*/ _regenerator().m(function _callee3(options) {
513
+ var rollupBuild, outputList;
514
+ return _regenerator().w(function (_context3) {
515
+ while (1)
516
+ switch (_context3.n) {
517
+ case 0:
518
+ _context3.n = 1;
519
+ return rollup.rollup(
520
+ mergeRollupOptions(_this.initOptions, options)
521
+ );
522
+ case 1:
523
+ rollupBuild = _context3.v;
524
+ outputList = [];
525
+ if (options.output) {
526
+ outputList = lang.isArray(options.output)
527
+ ? options.output
528
+ : [options.output];
529
+ }
530
+ return _context3.a(
531
+ 2,
532
+ Promise.resolve({
533
+ rebuild: (function () {
534
+ var _rebuild = _asyncToGenerator(
535
+ /*#__PURE__*/ _regenerator().m(function _callee() {
536
+ var outputOptions, i, output, writeRes;
537
+ return _regenerator().w(function (_context) {
538
+ while (1)
539
+ switch (_context.n) {
540
+ case 0:
541
+ outputOptions = [];
542
+ i = 0;
543
+ case 1:
544
+ if (!(i < outputList.length)) {
545
+ _context.n = 4;
546
+ break;
547
+ }
548
+ output = outputList[i];
549
+ _context.n = 2;
550
+ return rollupBuild.write(output);
551
+ case 2:
552
+ writeRes = _context.v;
553
+ outputOptions.push(writeRes);
554
+ case 3:
555
+ i++;
556
+ _context.n = 1;
557
+ break;
558
+ case 4:
559
+ return _context.a(
560
+ 2,
561
+ Promise.resolve({
562
+ rollupBuild: rollupBuild,
563
+ outputOptions: outputOptions,
564
+ })
565
+ );
566
+ }
567
+ }, _callee);
568
+ })
569
+ );
570
+ function rebuild() {
571
+ return _rebuild.apply(this, arguments);
375
572
  }
376
- output = outputList[i];
377
- _context.n = 2;
378
- return rollupBuild.write(output);
379
- case 2:
380
- writeRes = _context.v;
381
- outputOptions.push(writeRes);
382
- case 3:
383
- i++;
384
- _context.n = 1;
385
- break;
386
- case 4:
387
- return _context.a(2, Promise.resolve({
388
- rollupBuild: rollupBuild,
389
- outputOptions: outputOptions
390
- }));
391
- }
392
- }, _callee);
393
- }));
394
- function rebuild() {
395
- return _rebuild.apply(this, arguments);
396
- }
397
- return rebuild;
398
- }(),
399
- cancel: function () {
400
- var _cancel = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
401
- return _regenerator().w(function (_context2) {
402
- while (1) switch (_context2.n) {
403
- case 0:
404
- helper.cLog.warn('build', 'empty', 'Rollup does not need to be canceled.');
405
- case 1:
406
- return _context2.a(2);
407
- }
408
- }, _callee2);
409
- }));
410
- function cancel() {
411
- return _cancel.apply(this, arguments);
412
- }
413
- return cancel;
414
- }()
415
- }));
416
- }
417
- }, _callee3);
418
- }));
419
- return function (_x) {
420
- return _ref.apply(this, arguments);
421
- };
422
- }());
423
- _defineProperty(_this, "inOutMap", /*#__PURE__*/function () {
424
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(inputOutputMap) {
425
- var input;
426
- return _regenerator().w(function (_context4) {
427
- while (1) switch (_context4.n) {
428
- case 0:
429
- input = {};
430
- Object.entries(inputOutputMap).forEach(function (_ref3) {
431
- var _ref4 = _slicedToArray(_ref3, 2),
432
- input = _ref4[0],
433
- output = _ref4[1];
434
- input[output] = input;
435
- });
436
- return _context4.a(2, _this.build({
437
- input: input
438
- }));
439
- }
440
- }, _callee4);
441
- }));
442
- return function (_x2) {
443
- return _ref2.apply(this, arguments);
444
- };
445
- }());
446
- _defineProperty(_this, "input", /*#__PURE__*/function () {
447
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(input) {
448
- var rollupBuild;
449
- return _regenerator().w(function (_context6) {
450
- while (1) switch (_context6.n) {
451
- case 0:
452
- _context6.n = 1;
453
- return rollup.rollup(mergeRollupOptions(_this.initOptions, {
454
- input: input
455
- }));
456
- case 1:
457
- rollupBuild = _context6.v;
458
- return _context6.a(2, {
459
- output: function () {
460
- var _output2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_output) {
461
- var writeRes;
462
- return _regenerator().w(function (_context5) {
463
- while (1) switch (_context5.n) {
464
- case 0:
465
- _context5.n = 1;
466
- return rollupBuild.write(_output);
467
- case 1:
468
- writeRes = _context5.v;
469
- return _context5.a(2, {
470
- rollupBuild: rollupBuild,
471
- outputOptions: [writeRes]
472
- });
473
- }
474
- }, _callee5);
475
- }));
476
- function output(_x4) {
477
- return _output2.apply(this, arguments);
478
- }
479
- return output;
480
- }()
481
- });
482
- }
483
- }, _callee6);
484
- }));
485
- return function (_x3) {
486
- return _ref5.apply(this, arguments);
487
- };
488
- }());
489
- _defineProperty(_this, "build", /*#__PURE__*/function () {
490
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(options) {
491
- var rollupBuild, outputList, outputOptions, i, output, writeRes;
492
- return _regenerator().w(function (_context7) {
493
- while (1) switch (_context7.n) {
494
- case 0:
495
- _context7.n = 1;
496
- return rollup.rollup(mergeRollupOptions(_this.initOptions, options));
497
- case 1:
498
- rollupBuild = _context7.v;
499
- outputList = [];
500
- if (options.output) {
501
- outputList = lang.isArray(options.output) ? options.output : [options.output];
502
- }
503
- outputOptions = [];
504
- i = 0;
505
- case 2:
506
- if (!(i < outputList.length)) {
507
- _context7.n = 5;
508
- break;
509
- }
510
- output = outputList[i];
511
- _context7.n = 3;
512
- return rollupBuild.write(output);
513
- case 3:
514
- writeRes = _context7.v;
515
- outputOptions.push(writeRes);
516
- case 4:
517
- i++;
518
- _context7.n = 2;
519
- break;
520
- case 5:
521
- return _context7.a(2, {
522
- rollupBuild: rollupBuild,
523
- outputOptions: outputOptions
524
- });
525
- }
526
- }, _callee7);
527
- }));
528
- return function (_x5) {
529
- return _ref6.apply(this, arguments);
530
- };
531
- }());
532
- _defineProperty(_this, "watch", function (options) {
573
+ return rebuild;
574
+ })(),
575
+ cancel: (function () {
576
+ var _cancel = _asyncToGenerator(
577
+ /*#__PURE__*/ _regenerator().m(function _callee2() {
578
+ return _regenerator().w(function (_context2) {
579
+ while (1)
580
+ switch (_context2.n) {
581
+ case 0:
582
+ helper.cLog.warn(
583
+ 'build',
584
+ 'empty',
585
+ 'Rollup does not need to be canceled.'
586
+ );
587
+ case 1:
588
+ return _context2.a(2);
589
+ }
590
+ }, _callee2);
591
+ })
592
+ );
593
+ function cancel() {
594
+ return _cancel.apply(this, arguments);
595
+ }
596
+ return cancel;
597
+ })(),
598
+ })
599
+ );
600
+ }
601
+ }, _callee3);
602
+ })
603
+ );
604
+ return function (_x) {
605
+ return _ref.apply(this, arguments);
606
+ };
607
+ })()
608
+ );
609
+ _defineProperty(
610
+ _this,
611
+ 'inOutMap',
612
+ /*#__PURE__*/ (function () {
613
+ var _ref2 = _asyncToGenerator(
614
+ /*#__PURE__*/ _regenerator().m(function _callee4(inputOutputMap) {
615
+ var input;
616
+ return _regenerator().w(function (_context4) {
617
+ while (1)
618
+ switch (_context4.n) {
619
+ case 0:
620
+ input = {};
621
+ Object.entries(inputOutputMap).forEach(function (_ref3) {
622
+ var _ref4 = _slicedToArray(_ref3, 2),
623
+ input = _ref4[0],
624
+ output = _ref4[1];
625
+ input[output] = input;
626
+ });
627
+ return _context4.a(
628
+ 2,
629
+ _this.build({
630
+ input: input,
631
+ })
632
+ );
633
+ }
634
+ }, _callee4);
635
+ })
636
+ );
637
+ return function (_x2) {
638
+ return _ref2.apply(this, arguments);
639
+ };
640
+ })()
641
+ );
642
+ _defineProperty(
643
+ _this,
644
+ 'input',
645
+ /*#__PURE__*/ (function () {
646
+ var _ref5 = _asyncToGenerator(
647
+ /*#__PURE__*/ _regenerator().m(function _callee6(input) {
648
+ var rollupBuild;
649
+ return _regenerator().w(function (_context6) {
650
+ while (1)
651
+ switch (_context6.n) {
652
+ case 0:
653
+ _context6.n = 1;
654
+ return rollup.rollup(
655
+ mergeRollupOptions(_this.initOptions, {
656
+ input: input || _this.initOptions.input,
657
+ })
658
+ );
659
+ case 1:
660
+ rollupBuild = _context6.v;
661
+ return _context6.a(2, {
662
+ output: (function () {
663
+ var _output2 = _asyncToGenerator(
664
+ /*#__PURE__*/ _regenerator().m(
665
+ function _callee5(_output) {
666
+ var writeRes;
667
+ return _regenerator().w(function (_context5) {
668
+ while (1)
669
+ switch (_context5.n) {
670
+ case 0:
671
+ _context5.n = 1;
672
+ return rollupBuild.write(_output);
673
+ case 1:
674
+ writeRes = _context5.v;
675
+ return _context5.a(2, {
676
+ rollupBuild: rollupBuild,
677
+ outputOption: writeRes,
678
+ });
679
+ }
680
+ }, _callee5);
681
+ }
682
+ )
683
+ );
684
+ function output(_x4) {
685
+ return _output2.apply(this, arguments);
686
+ }
687
+ return output;
688
+ })(),
689
+ });
690
+ }
691
+ }, _callee6);
692
+ })
693
+ );
694
+ return function (_x3) {
695
+ return _ref5.apply(this, arguments);
696
+ };
697
+ })()
698
+ );
699
+ _defineProperty(
700
+ _this,
701
+ 'build',
702
+ /*#__PURE__*/ (function () {
703
+ var _ref6 = _asyncToGenerator(
704
+ /*#__PURE__*/ _regenerator().m(function _callee7(options) {
705
+ var rollupBuild, outputList, outputOptions, i, output, writeRes;
706
+ return _regenerator().w(function (_context7) {
707
+ while (1)
708
+ switch (_context7.n) {
709
+ case 0:
710
+ _context7.n = 1;
711
+ return rollup.rollup(
712
+ mergeRollupOptions(_this.initOptions, options)
713
+ );
714
+ case 1:
715
+ rollupBuild = _context7.v;
716
+ outputList = [];
717
+ if (options.output) {
718
+ outputList = lang.isArray(options.output)
719
+ ? options.output
720
+ : [options.output];
721
+ }
722
+ outputOptions = [];
723
+ i = 0;
724
+ case 2:
725
+ if (!(i < outputList.length)) {
726
+ _context7.n = 5;
727
+ break;
728
+ }
729
+ output = outputList[i];
730
+ _context7.n = 3;
731
+ return rollupBuild.write(output);
732
+ case 3:
733
+ writeRes = _context7.v;
734
+ outputOptions.push(writeRes);
735
+ case 4:
736
+ i++;
737
+ _context7.n = 2;
738
+ break;
739
+ case 5:
740
+ return _context7.a(2, {
741
+ rollupBuild: rollupBuild,
742
+ outputOptions: outputOptions,
743
+ });
744
+ }
745
+ }, _callee7);
746
+ })
747
+ );
748
+ return function (_x5) {
749
+ return _ref6.apply(this, arguments);
750
+ };
751
+ })()
752
+ );
753
+ _defineProperty(_this, 'watch', function (options) {
533
754
  var watchOptions = mergeRollupOptions(_this.initOptions, options);
534
755
  return rollup.watch(watchOptions);
535
756
  });
536
- _defineProperty(_this, "server", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
537
- return _regenerator().w(function (_context8) {
538
- while (1) switch (_context8.n) {
539
- case 0:
540
- helper.cLog.warn('serve', 'empty', 'Rollup does not support serve functionality.');
541
- return _context8.a(2);
542
- }
543
- }, _callee8);
544
- })));
757
+ _defineProperty(
758
+ _this,
759
+ 'server',
760
+ /*#__PURE__*/ _asyncToGenerator(
761
+ /*#__PURE__*/ _regenerator().m(function _callee8() {
762
+ return _regenerator().w(function (_context8) {
763
+ while (1)
764
+ switch (_context8.n) {
765
+ case 0:
766
+ helper.cLog.warn(
767
+ 'serve',
768
+ 'empty',
769
+ 'Rollup does not support serve functionality.'
770
+ );
771
+ return _context8.a(2);
772
+ }
773
+ }, _callee8);
774
+ })
775
+ )
776
+ );
545
777
  return _this;
546
778
  }
547
779
  _inherits(Compiler, _CompilerBase);
548
780
  return _createClass(Compiler);
549
- }(helper.CompilerBase);
781
+ })(helper.CompilerBase);
550
782
 
551
783
  /**
552
784
  * 获取external配置
@@ -565,17 +797,26 @@ var getExternal = function getExternal(_envParams, options) {
565
797
  if (filter) return filter;
566
798
 
567
799
  // 需要打包的模块
568
- var internalsMap = lang.isArray(internals) ? internals.reduce(function (prev, cur) {
569
- prev[cur] = cur;
570
- return prev;
571
- }, {}) : internals || {};
800
+ var internalsMap = lang.isArray(internals)
801
+ ? internals.reduce(function (prev, cur) {
802
+ prev[cur] = cur;
803
+ return prev;
804
+ }, {})
805
+ : internals || {};
572
806
 
573
807
  // 不需要打包的模块
574
- var extraExternals = lang.isArray(externals) ? externals : Object.keys(externals || {});
575
- var obj = _objectSpread2(_objectSpread2(_objectSpread2({}, dependencies), peerDependencies), devDependencies);
576
- var externalList = Object.keys(obj).concat(extraExternals).filter(function (key) {
577
- return !internalsMap[key];
578
- });
808
+ var extraExternals = lang.isArray(externals)
809
+ ? externals
810
+ : Object.keys(externals || {});
811
+ var obj = _objectSpread2(
812
+ _objectSpread2(_objectSpread2({}, dependencies), peerDependencies),
813
+ devDependencies
814
+ );
815
+ var externalList = Object.keys(obj)
816
+ .concat(extraExternals)
817
+ .filter(function (key) {
818
+ return !internalsMap[key];
819
+ });
579
820
  return function (source, _importer, _isResolved) {
580
821
  if (/^@doracli\//.test(source)) return true;
581
822
  var isExternal = externalList.find(function (externalModule) {
@@ -592,46 +833,64 @@ var getExternal = function getExternal(_envParams, options) {
592
833
  * @param input 入口文件路径
593
834
  * @returnscj
594
835
  */
595
- var getInput = /*#__PURE__*/function () {
596
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(envParams, input) {
597
- var workRootDir, rightFile;
598
- return _regenerator().w(function (_context) {
599
- while (1) switch (_context.n) {
600
- case 0:
601
- workRootDir = envParams.workRootDir;
602
- rightFile = input;
603
- if (!lang.isString(input)) {
604
- _context.n = 2;
605
- break;
606
- }
607
- _context.n = 1;
608
- return filePro.isValidDir(input);
609
- case 1:
610
- if (_context.v) {
611
- _context.n = 2;
612
- break;
613
- }
614
- helper.cLog.warn('rollup', 'input', "\u65E0\u6709\u6548\u5165\u53E3\u8DEF\u5F84 ".concat(input, "\uFF0C\u5C06\u81EA\u52A8\u5BFB\u627E\u6709\u6548\u8DEF\u5F84"));
615
- rightFile = undefined;
616
- case 2:
617
- if (!rightFile) {
618
- rightFile = helper.findInput(workRootDir);
619
- }
620
- if (!rightFile) {
621
- helper.cLog.error('common', 'find_input', '需要有一个入口文件 index 或者 src/index');
622
- process.exit();
836
+ var getInput = /*#__PURE__*/ (function () {
837
+ var _ref = _asyncToGenerator(
838
+ /*#__PURE__*/ _regenerator().m(function _callee(envParams, input) {
839
+ var workRootDir, rightFile;
840
+ return _regenerator().w(function (_context) {
841
+ while (1)
842
+ switch (_context.n) {
843
+ case 0:
844
+ workRootDir = envParams.workRootDir;
845
+ rightFile = input;
846
+ if (!lang.isString(input)) {
847
+ _context.n = 2;
848
+ break;
849
+ }
850
+ _context.n = 1;
851
+ return filePro.isValidDir(input);
852
+ case 1:
853
+ if (_context.v) {
854
+ _context.n = 2;
855
+ break;
856
+ }
857
+ helper.cLog.warn(
858
+ 'rollup',
859
+ 'input',
860
+ '\u65E0\u6709\u6548\u5165\u53E3\u8DEF\u5F84 '.concat(
861
+ input,
862
+ '\uFF0C\u5C06\u81EA\u52A8\u5BFB\u627E\u6709\u6548\u8DEF\u5F84'
863
+ )
864
+ );
865
+ rightFile = undefined;
866
+ case 2:
867
+ if (!rightFile) {
868
+ rightFile = helper.findInput(workRootDir);
869
+ }
870
+ if (!rightFile) {
871
+ helper.cLog.error(
872
+ 'common',
873
+ 'find_input',
874
+ '需要有一个入口文件 index 或者 src/index'
875
+ );
876
+ process.exit();
877
+ }
878
+ helper.cLog.log(
879
+ 'rollup',
880
+ 'input',
881
+ '\u5165\u53E3\u6587\u4EF6\u8DEF\u5F84 '.concat(rightFile)
882
+ );
883
+ return _context.a(2, rightFile);
623
884
  }
624
- helper.cLog.log('rollup', 'input', "\u5165\u53E3\u6587\u4EF6\u8DEF\u5F84 ".concat(rightFile));
625
- return _context.a(2, rightFile);
626
- }
627
- }, _callee);
628
- }));
885
+ }, _callee);
886
+ })
887
+ );
629
888
  return function getInput(_x, _x2) {
630
889
  return _ref.apply(this, arguments);
631
890
  };
632
- }();
891
+ })();
633
892
 
634
- var _excluded$3 = ["format"];
893
+ var _excluded$4 = ['format'];
635
894
  /**
636
895
  * 生成单个output
637
896
  * @description 如果不配置output,则默认生成cjs格式的output,输出路径为`lib/index.js`
@@ -645,19 +904,22 @@ var getOutput = function getOutput(envParams, options) {
645
904
  return {
646
905
  file: path.join(workRootDir, 'lib/index.js'),
647
906
  format: 'esm',
648
- sourcemap: false
907
+ sourcemap: false,
649
908
  };
650
909
  }
651
910
  var format = options.format,
652
- outputOptions = _objectWithoutProperties(options, _excluded$3);
911
+ outputOptions = _objectWithoutProperties(options, _excluded$4);
653
912
  var realFormat = format || 'esm';
654
- return _objectSpread2({
655
- format: realFormat,
656
- sourcemap: false
657
- }, outputOptions);
913
+ return _objectSpread2(
914
+ {
915
+ format: realFormat,
916
+ sourcemap: false,
917
+ },
918
+ outputOptions
919
+ );
658
920
  };
659
921
 
660
- var _excluded$2 = ["entries"];
922
+ var _excluded$3 = ['entries'];
661
923
 
662
924
  /**
663
925
  * 获取别名插件
@@ -671,10 +933,19 @@ var getAliasPlugin = function getAliasPlugin(config, pluginConfig) {
671
933
  var aliasObj = helper.getTsPathAlias(tsConfigPath || []);
672
934
  var _ref = pluginConfig || {},
673
935
  entries = _ref.entries,
674
- extPluginConfig = _objectWithoutProperties(_ref, _excluded$2);
675
- return alias(_objectSpread2(_objectSpread2({}, extPluginConfig), {}, {
676
- entries: _objectSpread2(_objectSpread2(_objectSpread2({}, entries), userConfig), aliasObj)
677
- }));
936
+ extPluginConfig = _objectWithoutProperties(_ref, _excluded$3);
937
+ return alias(
938
+ _objectSpread2(
939
+ _objectSpread2({}, extPluginConfig),
940
+ {},
941
+ {
942
+ entries: _objectSpread2(
943
+ _objectSpread2(_objectSpread2({}, entries), userConfig),
944
+ aliasObj
945
+ ),
946
+ }
947
+ )
948
+ );
678
949
  };
679
950
 
680
951
  /**
@@ -684,16 +955,31 @@ var getAliasPlugin = function getAliasPlugin(config, pluginConfig) {
684
955
  * @returns Babel插件
685
956
  */
686
957
  var getBabelPlugin = function getBabelPlugin(_config, pluginConfig) {
687
- return babel(_objectSpread2({
688
- babelrc: false,
689
- configFile: false,
690
- compact: false,
691
- cwd: filePro.getNodeModulesDir(filePro.getDirname(({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)) }))),
692
- extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.mjs'],
693
- ignore: ['node_modules/**'],
694
- babelHelpers: 'bundled',
695
- exclude: 'node_modules/**'
696
- }, pluginConfig));
958
+ return babel(
959
+ _objectSpread2(
960
+ {
961
+ babelrc: false,
962
+ configFile: false,
963
+ compact: false,
964
+ cwd: filePro.getNodeModulesDir(
965
+ filePro.getDirname({
966
+ url:
967
+ typeof document === 'undefined'
968
+ ? require('u' + 'rl').pathToFileURL(__filename).href
969
+ : (_documentCurrentScript &&
970
+ _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' &&
971
+ _documentCurrentScript.src) ||
972
+ new URL('index.js', document.baseURI).href,
973
+ })
974
+ ),
975
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.mjs'],
976
+ ignore: ['node_modules/**'],
977
+ babelHelpers: 'bundled',
978
+ exclude: 'node_modules/**',
979
+ },
980
+ pluginConfig
981
+ )
982
+ );
697
983
  };
698
984
 
699
985
  /**
@@ -707,7 +993,7 @@ var getCommonjsPlugin = function getCommonjsPlugin(_config, pluginConfig) {
707
993
  return commonjs(pluginConfig);
708
994
  };
709
995
 
710
- var _excluded$1 = ["targets"];
996
+ var _excluded$2 = ['targets'];
711
997
  /**
712
998
  * 获取拷贝插件
713
999
  * @param config 快捷配置
@@ -719,14 +1005,20 @@ var getCopyPlugin = function getCopyPlugin(config, pluginConfig) {
719
1005
  copyList = _ref.copyList;
720
1006
  var _ref2 = pluginConfig || {},
721
1007
  targets = _ref2.targets,
722
- extPluginConfig = _objectWithoutProperties(_ref2, _excluded$1);
1008
+ extPluginConfig = _objectWithoutProperties(_ref2, _excluded$2);
723
1009
  var resTargets = _toConsumableArray(targets || []);
724
1010
  if (copyList) {
725
1011
  resTargets.push.apply(resTargets, _toConsumableArray(copyList));
726
1012
  }
727
- return copy(_objectSpread2(_objectSpread2({}, extPluginConfig), {}, {
728
- targets: resTargets
729
- }));
1013
+ return copy(
1014
+ _objectSpread2(
1015
+ _objectSpread2({}, extPluginConfig),
1016
+ {},
1017
+ {
1018
+ targets: resTargets,
1019
+ }
1020
+ )
1021
+ );
730
1022
  };
731
1023
 
732
1024
  /**
@@ -736,11 +1028,16 @@ var getCopyPlugin = function getCopyPlugin(config, pluginConfig) {
736
1028
  * @returns
737
1029
  */
738
1030
  var getDtsPlugin = function getDtsPlugin(_config, pluginConfig) {
739
- return rollupPluginDts.dts(_objectSpread2({
740
- respectExternal: false,
741
- tsconfig: 'tsconfig.json',
742
- compilerOptions: {}
743
- }, pluginConfig));
1031
+ return rollupPluginDts.dts(
1032
+ _objectSpread2(
1033
+ {
1034
+ respectExternal: false,
1035
+ tsconfig: 'tsconfig.json',
1036
+ compilerOptions: {},
1037
+ },
1038
+ pluginConfig
1039
+ )
1040
+ );
744
1041
  };
745
1042
 
746
1043
  /**
@@ -762,7 +1059,7 @@ var getMinimizePlugin = function getMinimizePlugin() {
762
1059
  return terser();
763
1060
  };
764
1061
 
765
- var _excluded = ["plugins"];
1062
+ var _excluded$1 = ['plugins'];
766
1063
 
767
1064
  /**
768
1065
  * 创建Postcss插件
@@ -775,11 +1072,22 @@ var getPostcssPlugin = function getPostcssPlugin(config, pluginConfig) {
775
1072
  output = config.output;
776
1073
  var _ref = pluginConfig || {},
777
1074
  injectPlugin = _ref.plugins,
778
- otherConfig = _objectWithoutProperties(_ref, _excluded);
779
- var outputWhole = path.isAbsolute(output) ? output : path.resolve(process.cwd(), output);
780
- var plugins = [autoprefixer({
781
- overrideBrowserslist: ['defaults', 'not ie < 8', 'last 2 versions', '> 1%', 'iOS 7', 'last 3 iOS versions']
782
- })].concat(_toConsumableArray(injectPlugin || []));
1075
+ otherConfig = _objectWithoutProperties(_ref, _excluded$1);
1076
+ var outputWhole = path.isAbsolute(output)
1077
+ ? output
1078
+ : path.resolve(process.cwd(), output);
1079
+ var plugins = [
1080
+ autoprefixer({
1081
+ overrideBrowserslist: [
1082
+ 'defaults',
1083
+ 'not ie < 8',
1084
+ 'last 2 versions',
1085
+ '> 1%',
1086
+ 'iOS 7',
1087
+ 'last 3 iOS versions',
1088
+ ],
1089
+ }),
1090
+ ].concat(_toConsumableArray(injectPlugin || []));
783
1091
  if (minimize) {
784
1092
  plugins.push(cssnanoPlugin());
785
1093
  }
@@ -789,47 +1097,64 @@ var getPostcssPlugin = function getPostcssPlugin(config, pluginConfig) {
789
1097
  * 当输出n个格式时,会被同时调用n次
790
1098
  */
791
1099
  var codeFileNameLock = '';
792
- return postcss(_objectSpread2({
793
- plugins: plugins,
794
- extract: true,
795
- onExtract: function () {
796
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(getExtracted) {
797
- var _ref3, code, codeFileName, dir;
798
- return _regenerator().w(function (_context) {
799
- while (1) switch (_context.n) {
800
- case 0:
801
- _ref3 = getExtracted(), code = _ref3.code, codeFileName = _ref3.codeFileName;
802
- if (!(codeFileNameLock === codeFileName)) {
803
- _context.n = 1;
804
- break;
805
- }
806
- return _context.a(2, false);
807
- case 1:
808
- codeFileNameLock = codeFileName;
809
- if (filePro.isValidFilePathSync(outputWhole)) {
810
- fs.rmSync(outputWhole, {
811
- recursive: true,
812
- force: true
813
- });
814
- }
815
- dir = path.dirname(outputWhole);
816
- _context.n = 2;
817
- return filePro.mkdirRecursive(dir);
818
- case 2:
819
- _context.n = 3;
820
- return promises.writeFile(outputWhole, code);
821
- case 3:
822
- helper.cLog.info('style', 'success', "\u8F93\u51FA\u7C7B\u578B => css\uFF1B", "\u8DEF\u5F84 =>".concat(path.relative(filePro.getCwd(), outputWhole)));
823
- codeFileNameLock = '';
824
- return _context.a(2, false);
825
- }
826
- }, _callee);
827
- }));
828
- return function onExtract(_x) {
829
- return _ref2.apply(this, arguments);
830
- };
831
- }()
832
- }, otherConfig));
1100
+ return postcss(
1101
+ _objectSpread2(
1102
+ {
1103
+ plugins: plugins,
1104
+ extract: true,
1105
+ onExtract: (function () {
1106
+ var _ref2 = _asyncToGenerator(
1107
+ /*#__PURE__*/ _regenerator().m(function _callee(getExtracted) {
1108
+ var _ref3, code, codeFileName, dir;
1109
+ return _regenerator().w(function (_context) {
1110
+ while (1)
1111
+ switch (_context.n) {
1112
+ case 0:
1113
+ ((_ref3 = getExtracted()),
1114
+ (code = _ref3.code),
1115
+ (codeFileName = _ref3.codeFileName));
1116
+ if (!(codeFileNameLock === codeFileName)) {
1117
+ _context.n = 1;
1118
+ break;
1119
+ }
1120
+ return _context.a(2, false);
1121
+ case 1:
1122
+ codeFileNameLock = codeFileName;
1123
+ if (filePro.isValidFilePathSync(outputWhole)) {
1124
+ fs.rmSync(outputWhole, {
1125
+ recursive: true,
1126
+ force: true,
1127
+ });
1128
+ }
1129
+ dir = path.dirname(outputWhole);
1130
+ _context.n = 2;
1131
+ return filePro.mkdirRecursive(dir);
1132
+ case 2:
1133
+ _context.n = 3;
1134
+ return promises.writeFile(outputWhole, code);
1135
+ case 3:
1136
+ helper.cLog.info(
1137
+ 'style',
1138
+ 'success',
1139
+ '\u8F93\u51FA\u7C7B\u578B => css\uFF1B',
1140
+ '\u8DEF\u5F84 =>'.concat(
1141
+ path.relative(filePro.getCwd(), outputWhole)
1142
+ )
1143
+ );
1144
+ codeFileNameLock = '';
1145
+ return _context.a(2, false);
1146
+ }
1147
+ }, _callee);
1148
+ })
1149
+ );
1150
+ return function onExtract(_x) {
1151
+ return _ref2.apply(this, arguments);
1152
+ };
1153
+ })(),
1154
+ },
1155
+ otherConfig
1156
+ )
1157
+ );
833
1158
  };
834
1159
 
835
1160
  /**
@@ -840,10 +1165,15 @@ var getPostcssPlugin = function getPostcssPlugin(config, pluginConfig) {
840
1165
  */
841
1166
  var getResolvePlugin = function getResolvePlugin(config, pluginConfig) {
842
1167
  var extensions = config.extensions;
843
- return resolve(_objectSpread2({
844
- extensions: extensions,
845
- preferBuiltins: true
846
- }, pluginConfig));
1168
+ return resolve(
1169
+ _objectSpread2(
1170
+ {
1171
+ extensions: extensions,
1172
+ preferBuiltins: true,
1173
+ },
1174
+ pluginConfig
1175
+ )
1176
+ );
847
1177
  };
848
1178
 
849
1179
  /**
@@ -853,20 +1183,32 @@ var getResolvePlugin = function getResolvePlugin(config, pluginConfig) {
853
1183
  */
854
1184
  var getNodePlugins = function getNodePlugins(config) {
855
1185
  var alias = config.alias,
856
- minimize = config.minimize;
857
- config.copyMap;
858
- var plugins = [getResolvePlugin({
859
- extensions: ['.js', '.ts', '.json']
860
- }, {
861
- preferBuiltins: true
862
- }), getAliasPlugin({
863
- alias: _objectSpread2({
864
- '@': 'src'
865
- }, alias)
866
- }), getCopyPlugin({
867
- }), getCommonjsPlugin(), getJsonPlugin()];
868
- plugins.push(getBabelPlugin({
869
- }, presetBabel.nodeBabelPreset()));
1186
+ minimize = config.minimize,
1187
+ copyList = config.copyList;
1188
+ var plugins = [
1189
+ getResolvePlugin(
1190
+ {
1191
+ extensions: ['.js', '.ts', '.json'],
1192
+ },
1193
+ {
1194
+ preferBuiltins: true,
1195
+ }
1196
+ ),
1197
+ getAliasPlugin({
1198
+ alias: _objectSpread2(
1199
+ {
1200
+ '@': 'src',
1201
+ },
1202
+ alias
1203
+ ),
1204
+ }),
1205
+ getCopyPlugin({
1206
+ copyList: copyList,
1207
+ }),
1208
+ getCommonjsPlugin(),
1209
+ getJsonPlugin(),
1210
+ ];
1211
+ plugins.push(getBabelPlugin({}, presetBabel.nodeBabelPreset()));
870
1212
  if (minimize) {
871
1213
  plugins.push(getMinimizePlugin());
872
1214
  }
@@ -878,49 +1220,70 @@ var getNodePlugins = function getNodePlugins(config) {
878
1220
  * @param config 快捷配置
879
1221
  * @returns
880
1222
  */
881
- var getReactPlugins = /*#__PURE__*/function () {
882
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(config) {
883
- var alias, minimize, cssOutput, copy, plugins, _t, _t2, _t3, _t4, _t5, _t6;
884
- return _regenerator().w(function (_context) {
885
- while (1) switch (_context.n) {
886
- case 0:
887
- alias = config.alias, minimize = config.minimize, cssOutput = config.cssOutput, copy = config.copy;
888
- _context.n = 1;
889
- return getPostcssPlugin({
890
- minimize: !!minimize,
891
- output: cssOutput || 'lib/css/index.css'
892
- });
893
- case 1:
894
- _t = _context.v;
895
- _t2 = getResolvePlugin({
896
- extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.mjs']
897
- }, {
898
- preferBuiltins: true
899
- });
900
- _t3 = getAliasPlugin({
901
- alias: _objectSpread2({
902
- '@': 'src'
903
- }, alias)
904
- });
905
- _t4 = getCopyPlugin({
906
- copyList: copy
907
- });
908
- _t5 = getCommonjsPlugin();
909
- _t6 = getJsonPlugin();
910
- plugins = [_t, _t2, _t3, _t4, _t5, _t6];
911
- plugins.push(getBabelPlugin({
912
- }, presetBabel.reactBabelPreset()));
913
- if (minimize) {
914
- plugins.push(getMinimizePlugin());
1223
+ var getReactPlugins = /*#__PURE__*/ (function () {
1224
+ var _ref = _asyncToGenerator(
1225
+ /*#__PURE__*/ _regenerator().m(function _callee(config) {
1226
+ var alias,
1227
+ minimize,
1228
+ cssOutput,
1229
+ copy,
1230
+ plugins,
1231
+ _t,
1232
+ _t2,
1233
+ _t3,
1234
+ _t4,
1235
+ _t5,
1236
+ _t6;
1237
+ return _regenerator().w(function (_context) {
1238
+ while (1)
1239
+ switch (_context.n) {
1240
+ case 0:
1241
+ ((alias = config.alias),
1242
+ (minimize = config.minimize),
1243
+ (cssOutput = config.cssOutput),
1244
+ (copy = config.copy));
1245
+ _context.n = 1;
1246
+ return getPostcssPlugin({
1247
+ minimize: !!minimize,
1248
+ output: cssOutput || 'lib/css/index.css',
1249
+ });
1250
+ case 1:
1251
+ _t = _context.v;
1252
+ _t2 = getResolvePlugin(
1253
+ {
1254
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.mjs'],
1255
+ },
1256
+ {
1257
+ preferBuiltins: true,
1258
+ }
1259
+ );
1260
+ _t3 = getAliasPlugin({
1261
+ alias: _objectSpread2(
1262
+ {
1263
+ '@': 'src',
1264
+ },
1265
+ alias
1266
+ ),
1267
+ });
1268
+ _t4 = getCopyPlugin({
1269
+ copyList: copy,
1270
+ });
1271
+ _t5 = getCommonjsPlugin();
1272
+ _t6 = getJsonPlugin();
1273
+ plugins = [_t, _t2, _t3, _t4, _t5, _t6];
1274
+ plugins.push(getBabelPlugin({}, presetBabel.reactBabelPreset()));
1275
+ if (minimize) {
1276
+ plugins.push(getMinimizePlugin());
1277
+ }
1278
+ return _context.a(2, plugins);
915
1279
  }
916
- return _context.a(2, plugins);
917
- }
918
- }, _callee);
919
- }));
1280
+ }, _callee);
1281
+ })
1282
+ );
920
1283
  return function getReactPlugins(_x) {
921
1284
  return _ref.apply(this, arguments);
922
1285
  };
923
- }();
1286
+ })();
924
1287
 
925
1288
  /**
926
1289
  * 获取watch配置
@@ -929,134 +1292,145 @@ var getReactPlugins = /*#__PURE__*/function () {
929
1292
  */
930
1293
  var getWatch = function getWatch(envParams, options) {
931
1294
  var workRootDir = envParams.workRootDir;
932
- return _objectSpread2({
933
- exclude: 'node_modules/**',
934
- include: path.join(workRootDir, 'src/**'),
935
- clearScreen: false,
936
- skipWrite: false,
937
- buildDelay: 500,
938
- chokidar: {
939
- usePolling: true
940
- }
941
- }, options);
1295
+ return _objectSpread2(
1296
+ {
1297
+ exclude: 'node_modules/**',
1298
+ include: path.join(workRootDir, 'src/**'),
1299
+ clearScreen: false,
1300
+ skipWrite: false,
1301
+ buildDelay: 500,
1302
+ chokidar: {
1303
+ usePolling: true,
1304
+ },
1305
+ },
1306
+ options
1307
+ );
942
1308
  };
943
1309
 
944
- /**
945
- * Create a Rollup build with the given options.
946
- * @param options RollupOptions
947
- * @returns
948
- */
949
- var createRollupBuild = function createRollupBuild(options) {
950
- return rollup.rollup(options);
1310
+ var envParamsMw = function envParamsMw(envParams) {
1311
+ return function (ctx) {
1312
+ return function (next) {
1313
+ return /*#__PURE__*/ _asyncToGenerator(
1314
+ /*#__PURE__*/ _regenerator().m(function _callee() {
1315
+ return _regenerator().w(function (_context) {
1316
+ while (1)
1317
+ switch (_context.n) {
1318
+ case 0:
1319
+ ctx.updateEnvParams(envParams);
1320
+ return _context.a(2, next());
1321
+ }
1322
+ }, _callee);
1323
+ })
1324
+ );
1325
+ };
1326
+ };
951
1327
  };
952
1328
 
953
- var Ctx = /*#__PURE__*/function () {
954
- function Ctx(configCtx) {
955
- _classCallCheck(this, Ctx);
956
- _defineProperty(this, "configCtx", void 0);
957
- _defineProperty(this, "rollupOptions", {});
958
- _defineProperty(this, "rollupOutputList", []);
959
- _defineProperty(this, "envParams", {
960
- action: 'build',
961
- workRootDir: filePro.getCwd()
962
- });
963
- this.configCtx = configCtx;
964
- }
965
- return _createClass(Ctx, [{
966
- key: "updateEnvParams",
967
- value: function updateEnvParams(argv) {
968
- this.envParams = _objectSpread2(_objectSpread2({}, this.envParams), argv);
969
- }
970
- }, {
971
- key: "updateRollupOptions",
972
- value: function updateRollupOptions(options) {
973
- this.rollupOptions = _objectSpread2(_objectSpread2({}, this.rollupOptions), options);
974
- }
975
- }, {
976
- key: "updateRollupOutputList",
977
- value: function updateRollupOutputList(list) {
978
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
979
- if (force) {
980
- this.rollupOutputList = list;
981
- } else {
982
- this.rollupOutputList = [].concat(_toConsumableArray(this.rollupOutputList), _toConsumableArray(list));
983
- }
984
- }
985
- }, {
986
- key: "getDoraConfig",
987
- value: function getDoraConfig() {
988
- return this.configCtx.getDoraConfig();
989
- }
990
- }, {
991
- key: "geTDoraConfigRollup",
992
- value: function geTDoraConfigRollup() {
993
- return this.configCtx.getDoraConfig().rollupConfig || {};
994
- }
995
- }]);
996
- }();
997
-
998
- /**
999
- * Get a function to write the Rollup bundle with the given output options.
1000
- * @param rollupBuild RollupBuild
1001
- * @returns function that takes output options and writes the bundle
1002
- */
1003
- var getRollupWrite = function getRollupWrite(rollupBuild) {
1004
- return function (output) {
1005
- return rollupBuild.write(output);
1329
+ var rollupExternalMw = function rollupExternalMw() {
1330
+ return function (ctx) {
1331
+ return function (next) {
1332
+ return /*#__PURE__*/ _asyncToGenerator(
1333
+ /*#__PURE__*/ _regenerator().m(function _callee() {
1334
+ var _ref2,
1335
+ dependencies,
1336
+ devDependencies,
1337
+ peerDependencies,
1338
+ _ref3,
1339
+ externals,
1340
+ internals,
1341
+ dependFilter;
1342
+ return _regenerator().w(function (_context) {
1343
+ while (1)
1344
+ switch (_context.n) {
1345
+ case 0:
1346
+ ((_ref2 = ctx.configCtx.getPackageConfig() || {}),
1347
+ (dependencies = _ref2.dependencies),
1348
+ (devDependencies = _ref2.devDependencies),
1349
+ (peerDependencies = _ref2.peerDependencies));
1350
+ ((_ref3 = ctx.configCtx.getDoraConfig() || {}),
1351
+ (externals = _ref3.externals),
1352
+ (internals = _ref3.internals));
1353
+ dependFilter = helper.createDependFilter({
1354
+ dependencies: dependencies,
1355
+ devDependencies: devDependencies,
1356
+ peerDependencies: peerDependencies,
1357
+ externals: externals,
1358
+ internals: internals,
1359
+ });
1360
+ ctx.updateRollupOptions({
1361
+ external: function external(moduleId) {
1362
+ if (/^@doracli\//.test(moduleId)) return true;
1363
+ return dependFilter(moduleId);
1364
+ },
1365
+ });
1366
+ return _context.a(2, next());
1367
+ }
1368
+ }, _callee);
1369
+ })
1370
+ );
1371
+ };
1372
+ };
1373
+ };
1374
+ var rollupDtsExternalMw = function rollupDtsExternalMw() {
1375
+ return function (ctx) {
1376
+ return function (next) {
1377
+ return /*#__PURE__*/ _asyncToGenerator(
1378
+ /*#__PURE__*/ _regenerator().m(function _callee2() {
1379
+ var external;
1380
+ return _regenerator().w(function (_context2) {
1381
+ while (1)
1382
+ switch (_context2.n) {
1383
+ case 0:
1384
+ external = function external(id) {
1385
+ if (
1386
+ /\.(css|less|scss|sass|styl|png|jpe?g|svg|gif|webp|ico)$/.test(
1387
+ id
1388
+ )
1389
+ ) {
1390
+ return true;
1391
+ }
1392
+ return false;
1393
+ };
1394
+ ctx.updateRollupOptions({
1395
+ external: external,
1396
+ });
1397
+ return _context2.a(2, next());
1398
+ }
1399
+ }, _callee2);
1400
+ })
1401
+ );
1402
+ };
1006
1403
  };
1007
1404
  };
1008
1405
 
1406
+ var _excluded = ['file', 'dir', 'format'];
1009
1407
  /**
1010
- * 打包ts
1011
- * @param config 配置
1408
+ * 获取运行时输出配置
1409
+ * @param output
1410
+ * @param isMultiple
1411
+ * @param workRootDir
1412
+ * @returns
1012
1413
  */
1013
- var dealDts = /*#__PURE__*/function () {
1014
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(config) {
1015
- var input, output, dtsBuild, _t;
1016
- return _regenerator().w(function (_context) {
1017
- while (1) switch (_context.p = _context.n) {
1018
- case 0:
1019
- input = config.input, output = config.output;
1020
- _context.p = 1;
1021
- _context.n = 2;
1022
- return createRollupBuild({
1023
- input: input,
1024
- external: function external(id) {
1025
- if (/\.(css|less|scss|sass|styl|png|jpe?g|svg|gif|webp|ico)$/.test(id)) {
1026
- return true;
1027
- }
1028
- return false;
1029
- },
1030
- plugins: [getResolvePlugin({
1031
- extensions: ['.ts']
1032
- }, {
1033
- preferBuiltins: true
1034
- }), getDtsPlugin()]
1035
- });
1036
- case 2:
1037
- dtsBuild = _context.v;
1038
- _context.n = 3;
1039
- return getRollupWrite(dtsBuild)({
1040
- file: output
1041
- });
1042
- case 3:
1043
- _context.n = 5;
1044
- break;
1045
- case 4:
1046
- _context.p = 4;
1047
- _t = _context.v;
1048
- helper.cLog.error('dts ', 'dts_error', 'dts构建捕获到错误');
1049
- console.log(_t);
1050
- throw new Error(_t);
1051
- case 5:
1052
- return _context.a(2);
1053
- }
1054
- }, _callee, null, [[1, 4]]);
1055
- }));
1056
- return function dealDts(_x) {
1057
- return _ref.apply(this, arguments);
1058
- };
1059
- }();
1414
+ var getOutputRuntime = function getOutputRuntime(
1415
+ output,
1416
+ isMultiple,
1417
+ workRootDir
1418
+ ) {
1419
+ var file = output.file,
1420
+ dir = output.dir,
1421
+ format = output.format,
1422
+ extOutput = _objectWithoutProperties(output, _excluded);
1423
+ var fileWhole = isMultiple
1424
+ ? path.join(workRootDir, dir, format, file)
1425
+ : path.join(workRootDir, dir, file);
1426
+ return _objectSpread2(
1427
+ {
1428
+ file: fileWhole,
1429
+ format: format,
1430
+ },
1431
+ extOutput
1432
+ );
1433
+ };
1060
1434
 
1061
1435
  /**
1062
1436
  * 从rollup配置中,获取第一个input
@@ -1068,21 +1442,21 @@ var getFirstInput = function getFirstInput(inputOrigin) {
1068
1442
  var name = filePro.getFilename(inputOrigin);
1069
1443
  return {
1070
1444
  path: inputOrigin,
1071
- name: name
1445
+ name: name,
1072
1446
  };
1073
1447
  } else if (Array.isArray(inputOrigin) && inputOrigin.length > 0) {
1074
1448
  var firstInput = inputOrigin[0];
1075
1449
  var _name = filePro.getFilename(firstInput);
1076
1450
  return {
1077
1451
  path: firstInput,
1078
- name: _name
1452
+ name: _name,
1079
1453
  };
1080
1454
  } else if (lang.isObject(inputOrigin)) {
1081
1455
  var firstKey = Object.keys(inputOrigin)[0];
1082
1456
  var _firstInput = inputOrigin[firstKey];
1083
1457
  return {
1084
1458
  path: _firstInput,
1085
- name: firstKey
1459
+ name: firstKey,
1086
1460
  };
1087
1461
  }
1088
1462
  return undefined;
@@ -1123,22 +1497,44 @@ var rollupWatchLog = function rollupWatchLog(watcher) {
1123
1497
  switch (event.code) {
1124
1498
  case 'BUNDLE_END':
1125
1499
  // 这将确保在每次运行后正确关闭打包
1126
- helper.cLog.info('serve', event.code, "\u5355\u6B21\u6253\u5305\u5B8C\u6210");
1500
+ helper.cLog.info(
1501
+ 'serve',
1502
+ event.code,
1503
+ '\u5355\u6B21\u6253\u5305\u5B8C\u6210'
1504
+ );
1127
1505
  event.result.close();
1128
1506
  break;
1129
1507
  case 'ERROR':
1130
- helper.cLog.error('serve', event.code, "\u5355\u6B21\u6253\u5305\u6355\u83B7\u5230\u9519\u8BEF");
1508
+ helper.cLog.error(
1509
+ 'serve',
1510
+ event.code,
1511
+ '\u5355\u6B21\u6253\u5305\u6355\u83B7\u5230\u9519\u8BEF'
1512
+ );
1131
1513
  handleError(event.error, true);
1132
- (_event$result = event.result) === null || _event$result === void 0 || _event$result.close();
1514
+ (_event$result = event.result) === null ||
1515
+ _event$result === void 0 ||
1516
+ _event$result.close();
1133
1517
  break;
1134
1518
  case 'BUNDLE_START':
1135
- helper.cLog.log('serve', event.code, "\u5355\u6B21\u6253\u5305\u4E2D....");
1519
+ helper.cLog.log(
1520
+ 'serve',
1521
+ event.code,
1522
+ '\u5355\u6B21\u6253\u5305\u4E2D....'
1523
+ );
1136
1524
  break;
1137
1525
  case 'END':
1138
- helper.cLog.info('serve', event.code, "\u5B8C\u6210\u5355\u6B21\u6784\u5EFA");
1526
+ helper.cLog.info(
1527
+ 'serve',
1528
+ event.code,
1529
+ '\u5B8C\u6210\u5355\u6B21\u6784\u5EFA'
1530
+ );
1139
1531
  break;
1140
1532
  case 'START':
1141
- helper.cLog.log('serve', event.code, "\u76D1\u89C6\u5668\u6B63\u5728\uFF08\u91CD\u65B0\uFF09\u542F\u52A8");
1533
+ helper.cLog.log(
1534
+ 'serve',
1535
+ event.code,
1536
+ '\u76D1\u89C6\u5668\u6B63\u5728\uFF08\u91CD\u65B0\uFF09\u542F\u52A8'
1537
+ );
1142
1538
  break;
1143
1539
  }
1144
1540
  });
@@ -1148,7 +1544,13 @@ var rollupWatchLog = function rollupWatchLog(watcher) {
1148
1544
  watcher.on('change', function (id, _ref) {
1149
1545
  var event = _ref.event;
1150
1546
  /* 更改了一个文件 */
1151
- helper.cLog.log('serve', event.toUpperCase(), "".concat('检测到文件变动'.padEnd(12, ' '), " \u27A9 ").concat(helper.picocolors.cyan(path.relative(filePro.getCwd(), id))));
1547
+ helper.cLog.log(
1548
+ 'serve',
1549
+ event.toUpperCase(),
1550
+ ''
1551
+ .concat('检测到文件变动'.padEnd(12, ' '), ' ')
1552
+ .concat(helper.picocolors.cyan(path.relative(filePro.getCwd(), id)))
1553
+ );
1152
1554
  });
1153
1555
  watcher.on('restart', function () {
1154
1556
  /* 新触发了一次运行 */
@@ -1166,45 +1568,477 @@ var _picocolors$createCol = helper.picocolors.createColors(),
1166
1568
 
1167
1569
  // log to stderr to keep `rollup main.js > bundle.js` from breaking
1168
1570
  var stderr = function stderr() {
1169
- for (var _len = arguments.length, parameters = new Array(_len), _key = 0; _key < _len; _key++) {
1571
+ for (
1572
+ var _len = arguments.length, parameters = new Array(_len), _key = 0;
1573
+ _key < _len;
1574
+ _key++
1575
+ ) {
1170
1576
  parameters[_key] = arguments[_key];
1171
1577
  }
1172
- return process.stderr.write("".concat(parameters.join(''), "\n"));
1578
+ return process.stderr.write(''.concat(parameters.join(''), '\n'));
1173
1579
  };
1174
1580
  function handleError(error) {
1175
1581
  var _error$cause;
1176
- var recover = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1177
- var name = error.name || ((_error$cause = error.cause) === null || _error$cause === void 0 ? void 0 : _error$cause.name);
1178
- var nameSection = name ? "".concat(name, ": ") : '';
1179
- var pluginSection = error.plugin ? "(plugin ".concat(error.plugin, ") ") : '';
1180
- var message = "".concat(pluginSection).concat(nameSection).concat(error.message);
1181
- var outputLines = [bold(red("[!] ".concat(bold(message.toString()))))];
1582
+ var recover =
1583
+ arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1584
+ var name =
1585
+ error.name ||
1586
+ ((_error$cause = error.cause) === null || _error$cause === void 0
1587
+ ? void 0
1588
+ : _error$cause.name);
1589
+ var nameSection = name ? ''.concat(name, ': ') : '';
1590
+ var pluginSection = error.plugin ? '(plugin '.concat(error.plugin, ') ') : '';
1591
+ var message = ''
1592
+ .concat(pluginSection)
1593
+ .concat(nameSection)
1594
+ .concat(error.message);
1595
+ var outputLines = [bold(red('[!] '.concat(bold(message.toString()))))];
1182
1596
  if (error.url) {
1183
1597
  outputLines.push(cyan(error.url));
1184
1598
  }
1185
1599
  if (error.loc) {
1186
- outputLines.push(" (".concat(error.loc.line, ":").concat(error.loc.column, ")"));
1600
+ outputLines.push(
1601
+ ' ('.concat(error.loc.line, ':').concat(error.loc.column, ')')
1602
+ );
1187
1603
  }
1188
1604
  if (error.frame) {
1189
1605
  outputLines.push(dim(error.frame));
1190
1606
  }
1191
1607
  if (error.stack) {
1192
1608
  var _error$stack;
1193
- outputLines.push(dim((_error$stack = error.stack) === null || _error$stack === void 0 ? void 0 : _error$stack.replace("".concat(nameSection).concat(error.message, "\n"), '')));
1609
+ outputLines.push(
1610
+ dim(
1611
+ (_error$stack = error.stack) === null || _error$stack === void 0
1612
+ ? void 0
1613
+ : _error$stack.replace(
1614
+ ''.concat(nameSection).concat(error.message, '\n'),
1615
+ ''
1616
+ )
1617
+ )
1618
+ );
1194
1619
  }
1195
1620
  outputLines.push('', '');
1196
1621
  stderr(outputLines.join('\n'));
1197
1622
  if (!recover) process.exit(1);
1198
1623
  }
1199
1624
 
1200
- var rollupWatch = function rollupWatch(config) {
1201
- return rollup.watch(config);
1625
+ var rollupInputMw = function rollupInputMw() {
1626
+ return function (ctx) {
1627
+ return function (next) {
1628
+ return function () {
1629
+ var _ctx$getDoraConfig = ctx.getDoraConfig(),
1630
+ input = _ctx$getDoraConfig.input;
1631
+ var inputWhole = input;
1632
+ if (!inputWhole) {
1633
+ inputWhole = helper.findInput(ctx.envParams.workRootDir);
1634
+ if (!inputWhole) {
1635
+ helper.cLog.error(
1636
+ 'common',
1637
+ 'find_input',
1638
+ '需要有一个入口文件 index 或者 src/index'
1639
+ );
1640
+ process.exit();
1641
+ }
1642
+ }
1643
+ ctx.updateRollupOptions({
1644
+ input: inputWhole,
1645
+ });
1646
+ return next();
1647
+ };
1648
+ };
1649
+ };
1650
+ };
1651
+ var rollupOutputListMw = function rollupOutputListMw() {
1652
+ return function (ctx) {
1653
+ return function (next) {
1654
+ return function () {
1655
+ var _ctx$getDoraConfig2 = ctx.getDoraConfig(),
1656
+ input = _ctx$getDoraConfig2.input,
1657
+ output = _ctx$getDoraConfig2.output,
1658
+ formatList = _ctx$getDoraConfig2.formatList;
1659
+ var file = output.file,
1660
+ path = output.path;
1661
+ var outputFile = file;
1662
+ if (!outputFile) {
1663
+ var moduleName = filePro.getFilename(input);
1664
+ outputFile = ''.concat(moduleName, '.js');
1665
+ }
1666
+ var outputList = formatList.map(function (format) {
1667
+ return {
1668
+ dir: path,
1669
+ file: outputFile,
1670
+ format: format,
1671
+ };
1672
+ });
1673
+ ctx.updateRollupOutputList(outputList);
1674
+ return next();
1675
+ };
1676
+ };
1677
+ };
1202
1678
  };
1679
+ var rollupInoutMw = function rollupInoutMw() {
1680
+ return function (ctx) {
1681
+ return function (next) {
1682
+ return /*#__PURE__*/ _asyncToGenerator(
1683
+ /*#__PURE__*/ _regenerator().m(function _callee() {
1684
+ var _ctx$getDoraConfig3,
1685
+ input,
1686
+ output,
1687
+ formatList,
1688
+ file,
1689
+ path,
1690
+ inputWhole,
1691
+ outputFile,
1692
+ moduleName,
1693
+ outputList;
1694
+ return _regenerator().w(function (_context) {
1695
+ while (1)
1696
+ switch (_context.n) {
1697
+ case 0:
1698
+ ((_ctx$getDoraConfig3 = ctx.getDoraConfig()),
1699
+ (input = _ctx$getDoraConfig3.input),
1700
+ (output = _ctx$getDoraConfig3.output),
1701
+ (formatList = _ctx$getDoraConfig3.formatList));
1702
+ ((file = output.file), (path = output.path));
1703
+ inputWhole = input;
1704
+ outputFile = file;
1705
+ if (!inputWhole) {
1706
+ inputWhole = helper.findInput(ctx.envParams.workRootDir);
1707
+ if (!inputWhole) {
1708
+ helper.cLog.error(
1709
+ 'common',
1710
+ 'find_input',
1711
+ '需要有一个入口文件 index 或者 src/index'
1712
+ );
1713
+ process.exit();
1714
+ }
1715
+ }
1716
+ if (!outputFile) {
1717
+ moduleName = filePro.getFilename(inputWhole);
1718
+ outputFile = ''.concat(moduleName, '.js');
1719
+ }
1720
+ outputList = formatList.map(function (format) {
1721
+ return {
1722
+ dir: path,
1723
+ file: outputFile,
1724
+ format: format,
1725
+ };
1726
+ });
1727
+ ctx.updateRollupOptions({
1728
+ input: inputWhole,
1729
+ });
1730
+ ctx.updateRollupOutputList(outputList);
1731
+ return _context.a(2, next());
1732
+ }
1733
+ }, _callee);
1734
+ })
1735
+ );
1736
+ };
1737
+ };
1738
+ };
1739
+ var rollupWatchOutputMw = function rollupWatchOutputMw() {
1740
+ return function (ctx) {
1741
+ return function (next) {
1742
+ return /*#__PURE__*/ _asyncToGenerator(
1743
+ /*#__PURE__*/ _regenerator().m(function _callee2() {
1744
+ return _regenerator().w(function (_context2) {
1745
+ while (1)
1746
+ switch (_context2.n) {
1747
+ case 0:
1748
+ ctx.updateRollupOptions({
1749
+ output: ctx.rollupOutputList.map(function (output) {
1750
+ return getOutputRuntime(
1751
+ output,
1752
+ ctx.rollupOutputList.length > 1,
1753
+ ctx.envParams.workRootDir
1754
+ );
1755
+ }),
1756
+ });
1757
+ return _context2.a(2, next());
1758
+ }
1759
+ }, _callee2);
1760
+ })
1761
+ );
1762
+ };
1763
+ };
1764
+ };
1765
+ var rollupDtsInoutMw = function rollupDtsInoutMw() {
1766
+ return function (ctx) {
1767
+ return function (next) {
1768
+ return /*#__PURE__*/ _asyncToGenerator(
1769
+ /*#__PURE__*/ _regenerator().m(function _callee3() {
1770
+ var _ctx$getDoraConfig4, output, dts, dtsInput, dtsOutput;
1771
+ return _regenerator().w(function (_context3) {
1772
+ while (1)
1773
+ switch (_context3.n) {
1774
+ case 0:
1775
+ ((_ctx$getDoraConfig4 = ctx.getDoraConfig()),
1776
+ (output = _ctx$getDoraConfig4.output),
1777
+ (dts = _ctx$getDoraConfig4.dts));
1778
+ if (dts) {
1779
+ _context3.n = 1;
1780
+ break;
1781
+ }
1782
+ return _context3.a(2);
1783
+ case 1:
1784
+ dtsInput =
1785
+ (dts === null || dts === void 0 ? void 0 : dts.input) ||
1786
+ ctx.rollupOptions.input;
1787
+ dtsOutput =
1788
+ (dts === null || dts === void 0 ? void 0 : dts.output) ||
1789
+ path.resolve(output.path || './lib', 'type/index.d.ts');
1790
+ ctx.updateRollupOptions({
1791
+ input: dtsInput,
1792
+ });
1793
+ ctx.updateRollupOutputList([
1794
+ {
1795
+ file: dtsOutput,
1796
+ },
1797
+ ]);
1798
+ return _context3.a(2, next());
1799
+ }
1800
+ }, _callee3);
1801
+ })
1802
+ );
1803
+ };
1804
+ };
1805
+ };
1806
+
1807
+ var insertTsMw = function insertTsMw() {
1808
+ return function (ctx) {
1809
+ return function (next) {
1810
+ return /*#__PURE__*/ _asyncToGenerator(
1811
+ /*#__PURE__*/ _regenerator().m(function _callee() {
1812
+ var input;
1813
+ return _regenerator().w(function (_context) {
1814
+ while (1)
1815
+ switch (_context.n) {
1816
+ case 0:
1817
+ input = ctx.rollupOptions.input;
1818
+ if (!path.extname(input).toLowerCase().includes('ts')) {
1819
+ _context.n = 1;
1820
+ break;
1821
+ }
1822
+ _context.n = 1;
1823
+ return helper.insertTsconfig(ctx.envParams.workRootDir);
1824
+ case 1:
1825
+ return _context.a(2, next());
1826
+ }
1827
+ }, _callee);
1828
+ })
1829
+ );
1830
+ };
1831
+ };
1832
+ };
1833
+
1834
+ var rollupReactPluginMw = function rollupReactPluginMw() {
1835
+ return function (ctx) {
1836
+ return function (next) {
1837
+ return /*#__PURE__*/ _asyncToGenerator(
1838
+ /*#__PURE__*/ _regenerator().m(function _callee() {
1839
+ var _ctx$getDoraConfig,
1840
+ minimize,
1841
+ alias,
1842
+ copy,
1843
+ output,
1844
+ path$1,
1845
+ tsConfig,
1846
+ tsAlias,
1847
+ plugins;
1848
+ return _regenerator().w(function (_context) {
1849
+ while (1)
1850
+ switch (_context.n) {
1851
+ case 0:
1852
+ ((_ctx$getDoraConfig = ctx.getDoraConfig()),
1853
+ (minimize = _ctx$getDoraConfig.minimize),
1854
+ (alias = _ctx$getDoraConfig.alias),
1855
+ (copy = _ctx$getDoraConfig.copy),
1856
+ (output = _ctx$getDoraConfig.output));
1857
+ path$1 = output.path;
1858
+ tsConfig = ctx.configCtx.getTsConfig();
1859
+ tsAlias = helper.getTsPathAlias(tsConfig);
1860
+ _context.n = 1;
1861
+ return getReactPlugins({
1862
+ minimize: minimize,
1863
+ alias: _objectSpread2(_objectSpread2({}, tsAlias), alias),
1864
+ copy: copy,
1865
+ cssOutput: path.resolve(
1866
+ ctx.envParams.workRootDir,
1867
+ path$1,
1868
+ 'style/index.css'
1869
+ ),
1870
+ });
1871
+ case 1:
1872
+ plugins = _context.v;
1873
+ ctx.updateRollupOptions({
1874
+ plugins: plugins,
1875
+ });
1876
+ return _context.a(2, next());
1877
+ }
1878
+ }, _callee);
1879
+ })
1880
+ );
1881
+ };
1882
+ };
1883
+ };
1884
+ var rollupNodePluginMw = function rollupNodePluginMw() {
1885
+ return function (ctx) {
1886
+ return function (next) {
1887
+ return /*#__PURE__*/ _asyncToGenerator(
1888
+ /*#__PURE__*/ _regenerator().m(function _callee2() {
1889
+ var _ctx$getDoraConfig2, minimize, alias, tsConfig, tsAlias, plugins;
1890
+ return _regenerator().w(function (_context2) {
1891
+ while (1)
1892
+ switch (_context2.n) {
1893
+ case 0:
1894
+ ((_ctx$getDoraConfig2 = ctx.getDoraConfig()),
1895
+ (minimize = _ctx$getDoraConfig2.minimize),
1896
+ (alias = _ctx$getDoraConfig2.alias));
1897
+ tsConfig = ctx.configCtx.getTsConfig();
1898
+ tsAlias = helper.getTsPathAlias(tsConfig);
1899
+ _context2.n = 1;
1900
+ return getNodePlugins({
1901
+ minimize: minimize,
1902
+ alias: _objectSpread2(_objectSpread2({}, tsAlias), alias),
1903
+ });
1904
+ case 1:
1905
+ plugins = _context2.v;
1906
+ ctx.updateRollupOptions({
1907
+ plugins: plugins,
1908
+ });
1909
+ return _context2.a(2, next());
1910
+ }
1911
+ }, _callee2);
1912
+ })
1913
+ );
1914
+ };
1915
+ };
1916
+ };
1917
+ var rollupDtsPluginMw = function rollupDtsPluginMw() {
1918
+ return function (ctx) {
1919
+ return function (next) {
1920
+ return /*#__PURE__*/ _asyncToGenerator(
1921
+ /*#__PURE__*/ _regenerator().m(function _callee3() {
1922
+ var plugins;
1923
+ return _regenerator().w(function (_context3) {
1924
+ while (1)
1925
+ switch (_context3.n) {
1926
+ case 0:
1927
+ plugins = [
1928
+ getResolvePlugin(
1929
+ {
1930
+ extensions: ['.ts'],
1931
+ },
1932
+ {
1933
+ preferBuiltins: true,
1934
+ }
1935
+ ),
1936
+ getDtsPlugin(),
1937
+ ];
1938
+ ctx.updateRollupOptions({
1939
+ plugins: plugins,
1940
+ });
1941
+ return _context3.a(2, next());
1942
+ }
1943
+ }, _callee3);
1944
+ })
1945
+ );
1946
+ };
1947
+ };
1948
+ };
1949
+
1950
+ var rollupWatchMw = function rollupWatchMw() {
1951
+ return function (ctx) {
1952
+ return function (next) {
1953
+ return /*#__PURE__*/ _asyncToGenerator(
1954
+ /*#__PURE__*/ _regenerator().m(function _callee() {
1955
+ var watch;
1956
+ return _regenerator().w(function (_context) {
1957
+ while (1)
1958
+ switch (_context.n) {
1959
+ case 0:
1960
+ _context.n = 1;
1961
+ return getWatch(ctx.envParams);
1962
+ case 1:
1963
+ watch = _context.v;
1964
+ ctx.updateRollupOptions({
1965
+ watch: watch,
1966
+ });
1967
+ return _context.a(2, next());
1968
+ }
1969
+ }, _callee);
1970
+ })
1971
+ );
1972
+ };
1973
+ };
1974
+ };
1975
+
1976
+ var Ctx = /*#__PURE__*/ (function () {
1977
+ function Ctx(configCtx) {
1978
+ _classCallCheck(this, Ctx);
1979
+ _defineProperty(this, 'configCtx', void 0);
1980
+ _defineProperty(this, 'rollupOptions', {});
1981
+ _defineProperty(this, 'rollupOutputList', []);
1982
+ _defineProperty(this, 'envParams', {
1983
+ action: 'build',
1984
+ workRootDir: filePro.getCwd(),
1985
+ });
1986
+ this.configCtx = configCtx;
1987
+ }
1988
+ return _createClass(Ctx, [
1989
+ {
1990
+ key: 'updateEnvParams',
1991
+ value: function updateEnvParams(argv) {
1992
+ this.envParams = _objectSpread2(
1993
+ _objectSpread2({}, this.envParams),
1994
+ argv
1995
+ );
1996
+ },
1997
+ },
1998
+ {
1999
+ key: 'updateRollupOptions',
2000
+ value: function updateRollupOptions(options) {
2001
+ this.rollupOptions = _objectSpread2(
2002
+ _objectSpread2({}, this.rollupOptions),
2003
+ options
2004
+ );
2005
+ },
2006
+ },
2007
+ {
2008
+ key: 'updateRollupOutputList',
2009
+ value: function updateRollupOutputList(list) {
2010
+ var force =
2011
+ arguments.length > 1 && arguments[1] !== undefined
2012
+ ? arguments[1]
2013
+ : false;
2014
+ if (force) {
2015
+ this.rollupOutputList = list;
2016
+ } else {
2017
+ this.rollupOutputList = [].concat(
2018
+ _toConsumableArray(this.rollupOutputList),
2019
+ _toConsumableArray(list)
2020
+ );
2021
+ }
2022
+ },
2023
+ },
2024
+ {
2025
+ key: 'getDoraConfig',
2026
+ value: function getDoraConfig() {
2027
+ return this.configCtx.getDoraConfig();
2028
+ },
2029
+ },
2030
+ {
2031
+ key: 'geTDoraConfigRollup',
2032
+ value: function geTDoraConfigRollup() {
2033
+ return this.configCtx.getDoraConfig().rollupConfig || {};
2034
+ },
2035
+ },
2036
+ ]);
2037
+ })();
1203
2038
 
1204
2039
  exports.Compiler = Compiler;
1205
2040
  exports.Ctx = Ctx;
1206
- exports.createRollupBuild = createRollupBuild;
1207
- exports.dealDts = dealDts;
2041
+ exports.envParamsMw = envParamsMw;
1208
2042
  exports.getAliasPlugin = getAliasPlugin;
1209
2043
  exports.getBabelPlugin = getBabelPlugin;
1210
2044
  exports.getCommonjsPlugin = getCommonjsPlugin;
@@ -1217,12 +2051,23 @@ exports.getJsonPlugin = getJsonPlugin;
1217
2051
  exports.getMinimizePlugin = getMinimizePlugin;
1218
2052
  exports.getNodePlugins = getNodePlugins;
1219
2053
  exports.getOutput = getOutput;
2054
+ exports.getOutputRuntime = getOutputRuntime;
1220
2055
  exports.getPostcssPlugin = getPostcssPlugin;
1221
2056
  exports.getReactPlugins = getReactPlugins;
1222
2057
  exports.getResolvePlugin = getResolvePlugin;
1223
- exports.getRollupWrite = getRollupWrite;
1224
2058
  exports.getWatch = getWatch;
1225
2059
  exports.handleError = handleError;
2060
+ exports.insertTsMw = insertTsMw;
1226
2061
  exports.mergeRollupOptions = mergeRollupOptions;
1227
- exports.rollupWatch = rollupWatch;
2062
+ exports.rollupDtsExternalMw = rollupDtsExternalMw;
2063
+ exports.rollupDtsInoutMw = rollupDtsInoutMw;
2064
+ exports.rollupDtsPluginMw = rollupDtsPluginMw;
2065
+ exports.rollupExternalMw = rollupExternalMw;
2066
+ exports.rollupInoutMw = rollupInoutMw;
2067
+ exports.rollupInputMw = rollupInputMw;
2068
+ exports.rollupNodePluginMw = rollupNodePluginMw;
2069
+ exports.rollupOutputListMw = rollupOutputListMw;
2070
+ exports.rollupReactPluginMw = rollupReactPluginMw;
1228
2071
  exports.rollupWatchLog = rollupWatchLog;
2072
+ exports.rollupWatchMw = rollupWatchMw;
2073
+ exports.rollupWatchOutputMw = rollupWatchOutputMw;