@doracli/rollup-react 0.0.4 → 0.0.5
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 +3 -827
- package/lib/esm/index.js +3 -831
- package/lib/type/index.d.ts +12 -28
- package/package.json +10 -10
package/lib/esm/index.js
CHANGED
|
@@ -1,831 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
clearMw as l,
|
|
5
|
-
cLog as p,
|
|
6
|
-
collectBaseConfigMw as i,
|
|
7
|
-
collectDoraConfigMw as c,
|
|
8
|
-
collectPackageJsonMw as u,
|
|
9
|
-
collectTsconfigJsonMw as a,
|
|
10
|
-
ConfigCtx as o,
|
|
11
|
-
configCtxWorkflow as e,
|
|
12
|
-
splitDoraCliConfig as m,
|
|
13
|
-
wholeDoraConfigMw as s,
|
|
14
|
-
wholeDoraInoutMw as f,
|
|
15
|
-
} from '@doracli/helper';
|
|
16
|
-
import {
|
|
17
|
-
Compiler as O,
|
|
18
|
-
Ctx as v,
|
|
19
|
-
envParamsMw as h,
|
|
20
|
-
getOutputRuntime as j,
|
|
21
|
-
insertTsMw as g,
|
|
22
|
-
rollupDtsExternalMw as P,
|
|
23
|
-
rollupDtsInoutMw as D,
|
|
24
|
-
rollupDtsPluginMw as R,
|
|
25
|
-
rollupExternalMw as y,
|
|
26
|
-
rollupInoutMw as w,
|
|
27
|
-
rollupInputMw as k,
|
|
28
|
-
rollupReactPluginMw as b,
|
|
29
|
-
rollupWatchLog as S,
|
|
30
|
-
rollupWatchMw as _,
|
|
31
|
-
rollupWatchOutputMw as C,
|
|
32
|
-
} from '@doracli/rollup';
|
|
33
|
-
function x(t, n, r, e, o, i, u) {
|
|
34
|
-
try {
|
|
35
|
-
var a = t[i](u),
|
|
36
|
-
c = a.value;
|
|
37
|
-
} catch (t) {
|
|
38
|
-
return void r(t);
|
|
39
|
-
}
|
|
40
|
-
a.done ? n(c) : Promise.resolve(c).then(e, o);
|
|
41
|
-
}
|
|
42
|
-
function E(t) {
|
|
43
|
-
return function () {
|
|
44
|
-
var n = this,
|
|
45
|
-
r = arguments;
|
|
46
|
-
return new Promise(function (e, o) {
|
|
47
|
-
var i = t.apply(n, r);
|
|
48
|
-
function u(t) {
|
|
49
|
-
x(i, e, o, u, a, 'next', t);
|
|
50
|
-
}
|
|
51
|
-
function a(t) {
|
|
52
|
-
x(i, e, o, u, a, 'throw', t);
|
|
53
|
-
}
|
|
54
|
-
u(void 0);
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function N(t, n, r) {
|
|
59
|
-
return (
|
|
60
|
-
(n = (function (t) {
|
|
61
|
-
var n = (function (t, n) {
|
|
62
|
-
if ('object' != typeof t || !t) return t;
|
|
63
|
-
var r = t[Symbol.toPrimitive];
|
|
64
|
-
if (void 0 !== r) {
|
|
65
|
-
var e = r.call(t, n);
|
|
66
|
-
if ('object' != typeof e) return e;
|
|
67
|
-
throw new TypeError('@@toPrimitive must return a primitive value.');
|
|
68
|
-
}
|
|
69
|
-
return ('string' === n ? String : Number)(t);
|
|
70
|
-
})(t, 'string');
|
|
71
|
-
return 'symbol' == typeof n ? n : n + '';
|
|
72
|
-
})(n)) in t
|
|
73
|
-
? Object.defineProperty(t, n, {
|
|
74
|
-
value: r,
|
|
75
|
-
enumerable: !0,
|
|
76
|
-
configurable: !0,
|
|
77
|
-
writable: !0,
|
|
78
|
-
})
|
|
79
|
-
: (t[n] = r),
|
|
80
|
-
t
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
function T(t, n) {
|
|
84
|
-
var r = Object.keys(t);
|
|
85
|
-
if (Object.getOwnPropertySymbols) {
|
|
86
|
-
var e = Object.getOwnPropertySymbols(t);
|
|
87
|
-
(n &&
|
|
88
|
-
(e = e.filter(function (n) {
|
|
89
|
-
return Object.getOwnPropertyDescriptor(t, n).enumerable;
|
|
90
|
-
})),
|
|
91
|
-
r.push.apply(r, e));
|
|
92
|
-
}
|
|
93
|
-
return r;
|
|
94
|
-
}
|
|
95
|
-
function G(t) {
|
|
96
|
-
for (var n = 1; n < arguments.length; n++) {
|
|
97
|
-
var r = null != arguments[n] ? arguments[n] : {};
|
|
98
|
-
n % 2
|
|
99
|
-
? T(Object(r), !0).forEach(function (n) {
|
|
100
|
-
N(t, n, r[n]);
|
|
101
|
-
})
|
|
102
|
-
: Object.getOwnPropertyDescriptors
|
|
103
|
-
? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r))
|
|
104
|
-
: T(Object(r)).forEach(function (n) {
|
|
105
|
-
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
return t;
|
|
109
|
-
}
|
|
110
|
-
function L() {
|
|
111
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
112
|
-
var t,
|
|
113
|
-
n,
|
|
114
|
-
r = 'function' == typeof Symbol ? Symbol : {},
|
|
115
|
-
e = r.iterator || '@@iterator',
|
|
116
|
-
o = r.toStringTag || '@@toStringTag';
|
|
117
|
-
function i(r, e, o, i) {
|
|
118
|
-
var c = e && e.prototype instanceof a ? e : a,
|
|
119
|
-
s = Object.create(c.prototype);
|
|
120
|
-
return (
|
|
121
|
-
z(
|
|
122
|
-
s,
|
|
123
|
-
'_invoke',
|
|
124
|
-
(function (r, e, o) {
|
|
125
|
-
var i,
|
|
126
|
-
a,
|
|
127
|
-
c,
|
|
128
|
-
s = 0,
|
|
129
|
-
f = o || [],
|
|
130
|
-
l = !1,
|
|
131
|
-
p = {
|
|
132
|
-
p: 0,
|
|
133
|
-
n: 0,
|
|
134
|
-
v: t,
|
|
135
|
-
a: m,
|
|
136
|
-
f: m.bind(t, 4),
|
|
137
|
-
d: function (n, r) {
|
|
138
|
-
return ((i = n), (a = 0), (c = t), (p.n = r), u);
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
function m(r, e) {
|
|
142
|
-
for (a = r, c = e, n = 0; !l && s && !o && n < f.length; n++) {
|
|
143
|
-
var o,
|
|
144
|
-
i = f[n],
|
|
145
|
-
m = p.p,
|
|
146
|
-
d = i[2];
|
|
147
|
-
r > 3
|
|
148
|
-
? (o = d === e) &&
|
|
149
|
-
((c = i[(a = i[4]) ? 5 : ((a = 3), 3)]), (i[4] = i[5] = t))
|
|
150
|
-
: i[0] <= m &&
|
|
151
|
-
((o = r < 2 && m < i[1])
|
|
152
|
-
? ((a = 0), (p.v = e), (p.n = i[1]))
|
|
153
|
-
: m < d &&
|
|
154
|
-
(o = r < 3 || i[0] > e || e > d) &&
|
|
155
|
-
((i[4] = r), (i[5] = e), (p.n = d), (a = 0)));
|
|
156
|
-
}
|
|
157
|
-
if (o || r > 1) return u;
|
|
158
|
-
throw ((l = !0), e);
|
|
159
|
-
}
|
|
160
|
-
return function (o, f, d) {
|
|
161
|
-
if (s > 1) throw TypeError('Generator is already running');
|
|
162
|
-
for (
|
|
163
|
-
l && 1 === f && m(f, d), a = f, c = d;
|
|
164
|
-
(n = a < 2 ? t : c) || !l;
|
|
165
|
-
|
|
166
|
-
) {
|
|
167
|
-
i ||
|
|
168
|
-
(a
|
|
169
|
-
? a < 3
|
|
170
|
-
? (a > 1 && (p.n = -1), m(a, c))
|
|
171
|
-
: (p.n = c)
|
|
172
|
-
: (p.v = c));
|
|
173
|
-
try {
|
|
174
|
-
if (((s = 2), i)) {
|
|
175
|
-
if ((a || (o = 'next'), (n = i[o]))) {
|
|
176
|
-
if (!(n = n.call(i, c)))
|
|
177
|
-
throw TypeError('iterator result is not an object');
|
|
178
|
-
if (!n.done) return n;
|
|
179
|
-
((c = n.value), a < 2 && (a = 0));
|
|
180
|
-
} else
|
|
181
|
-
(1 === a && (n = i.return) && n.call(i),
|
|
182
|
-
a < 2 &&
|
|
183
|
-
((c = TypeError(
|
|
184
|
-
"The iterator does not provide a '" + o + "' method"
|
|
185
|
-
)),
|
|
186
|
-
(a = 1)));
|
|
187
|
-
i = t;
|
|
188
|
-
} else if ((n = (l = p.n < 0) ? c : r.call(e, p)) !== u) break;
|
|
189
|
-
} catch (n) {
|
|
190
|
-
((i = t), (a = 1), (c = n));
|
|
191
|
-
} finally {
|
|
192
|
-
s = 1;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return { value: n, done: l };
|
|
196
|
-
};
|
|
197
|
-
})(r, o, i),
|
|
198
|
-
!0
|
|
199
|
-
),
|
|
200
|
-
s
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
var u = {};
|
|
204
|
-
function a() {}
|
|
205
|
-
function c() {}
|
|
206
|
-
function s() {}
|
|
207
|
-
n = Object.getPrototypeOf;
|
|
208
|
-
var f = [][e]
|
|
209
|
-
? n(n([][e]()))
|
|
210
|
-
: (z((n = {}), e, function () {
|
|
211
|
-
return this;
|
|
212
|
-
}),
|
|
213
|
-
n),
|
|
214
|
-
l = (s.prototype = a.prototype = Object.create(f));
|
|
215
|
-
function p(t) {
|
|
216
|
-
return (
|
|
217
|
-
Object.setPrototypeOf
|
|
218
|
-
? Object.setPrototypeOf(t, s)
|
|
219
|
-
: ((t.__proto__ = s), z(t, o, 'GeneratorFunction')),
|
|
220
|
-
(t.prototype = Object.create(l)),
|
|
221
|
-
t
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
return (
|
|
225
|
-
(c.prototype = s),
|
|
226
|
-
z(l, 'constructor', s),
|
|
227
|
-
z(s, 'constructor', c),
|
|
228
|
-
(c.displayName = 'GeneratorFunction'),
|
|
229
|
-
z(s, o, 'GeneratorFunction'),
|
|
230
|
-
z(l),
|
|
231
|
-
z(l, o, 'Generator'),
|
|
232
|
-
z(l, e, function () {
|
|
233
|
-
return this;
|
|
234
|
-
}),
|
|
235
|
-
z(l, 'toString', function () {
|
|
236
|
-
return '[object Generator]';
|
|
237
|
-
}),
|
|
238
|
-
(L = function () {
|
|
239
|
-
return { w: i, m: p };
|
|
240
|
-
})()
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
function z(t, n, r, e) {
|
|
244
|
-
var o = Object.defineProperty;
|
|
245
|
-
try {
|
|
246
|
-
o({}, '', {});
|
|
247
|
-
} catch (t) {
|
|
248
|
-
o = 0;
|
|
249
|
-
}
|
|
250
|
-
((z = function (t, n, r, e) {
|
|
251
|
-
function i(n, r) {
|
|
252
|
-
z(t, n, function (t) {
|
|
253
|
-
return this._invoke(n, r, t);
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
n
|
|
257
|
-
? o
|
|
258
|
-
? o(t, n, { value: r, enumerable: !e, configurable: !e, writable: !e })
|
|
259
|
-
: (t[n] = r)
|
|
260
|
-
: (i('next', 0), i('throw', 1), i('return', 2));
|
|
261
|
-
}),
|
|
262
|
-
z(t, n, r, e));
|
|
263
|
-
}
|
|
264
|
-
var F = {
|
|
265
|
-
multiple: !1,
|
|
266
|
-
output: { path: './lib' },
|
|
267
|
-
formatList: ['cjs', 'esm'],
|
|
268
|
-
alias: {},
|
|
269
|
-
externals: [],
|
|
270
|
-
internals: [],
|
|
271
|
-
minimize: !0,
|
|
272
|
-
clear: !1,
|
|
273
|
-
copy: [],
|
|
274
|
-
dts: {},
|
|
275
|
-
},
|
|
276
|
-
V = G(G({}, F), {}, { minimize: !0, clear: !0 }),
|
|
277
|
-
q = { dev: 'development', build: 'production', watch: 'development' },
|
|
278
|
-
A = (function () {
|
|
279
|
-
var t = E(
|
|
280
|
-
L().m(function t(n, r, p) {
|
|
281
|
-
var m;
|
|
282
|
-
return L().w(function (t) {
|
|
283
|
-
for (;;)
|
|
284
|
-
switch (t.n) {
|
|
285
|
-
case 0:
|
|
286
|
-
return (
|
|
287
|
-
(m = e(new o())).use(i(n.workRootDir, r)),
|
|
288
|
-
m.use(u()),
|
|
289
|
-
m.use(a()),
|
|
290
|
-
m.use(c(q[n.action])),
|
|
291
|
-
m.use(s(p)),
|
|
292
|
-
m.use(f()),
|
|
293
|
-
m.use(l()),
|
|
294
|
-
(t.n = 1),
|
|
295
|
-
m.getResult()
|
|
296
|
-
);
|
|
297
|
-
case 1:
|
|
298
|
-
return t.a(2, t.v);
|
|
299
|
-
}
|
|
300
|
-
}, t);
|
|
301
|
-
})
|
|
302
|
-
);
|
|
303
|
-
return function (n, r, e) {
|
|
304
|
-
return t.apply(this, arguments);
|
|
305
|
-
};
|
|
306
|
-
})(),
|
|
307
|
-
B = function (t, n) {
|
|
308
|
-
var r = e(new v(t));
|
|
309
|
-
return (
|
|
310
|
-
r.use(h(n)),
|
|
311
|
-
r.use(w()),
|
|
312
|
-
r.use(y()),
|
|
313
|
-
r.use(b()),
|
|
314
|
-
r.use(g()),
|
|
315
|
-
r.getResult()
|
|
316
|
-
);
|
|
317
|
-
},
|
|
318
|
-
H = (function () {
|
|
319
|
-
var n = E(
|
|
320
|
-
L().m(function n(r) {
|
|
321
|
-
var e, o, i, u;
|
|
322
|
-
return L().w(function (n) {
|
|
323
|
-
for (;;)
|
|
324
|
-
switch (n.n) {
|
|
325
|
-
case 0:
|
|
326
|
-
return (
|
|
327
|
-
(e = r.rollupOutputList),
|
|
328
|
-
(o = e.length > 1),
|
|
329
|
-
(i = new O(r.rollupOptions)),
|
|
330
|
-
(n.n = 1),
|
|
331
|
-
i.input()
|
|
332
|
-
);
|
|
333
|
-
case 1:
|
|
334
|
-
return (
|
|
335
|
-
(u = n.v),
|
|
336
|
-
n.a(
|
|
337
|
-
2,
|
|
338
|
-
Promise.all(
|
|
339
|
-
e.map(
|
|
340
|
-
(function () {
|
|
341
|
-
var n = E(
|
|
342
|
-
L().m(function n(e) {
|
|
343
|
-
var i;
|
|
344
|
-
return L().w(function (n) {
|
|
345
|
-
for (;;)
|
|
346
|
-
if (0 === n.n)
|
|
347
|
-
return (
|
|
348
|
-
(i = j(e, o, r.envParams.workRootDir)),
|
|
349
|
-
n.a(
|
|
350
|
-
2,
|
|
351
|
-
u.output(i).then(function () {
|
|
352
|
-
p.info(
|
|
353
|
-
'build',
|
|
354
|
-
'success',
|
|
355
|
-
'输出类型 => '.concat(
|
|
356
|
-
i.format,
|
|
357
|
-
';'
|
|
358
|
-
),
|
|
359
|
-
'路径 =>'.concat(t(d(), i.file))
|
|
360
|
-
);
|
|
361
|
-
})
|
|
362
|
-
)
|
|
363
|
-
);
|
|
364
|
-
}, n);
|
|
365
|
-
})
|
|
366
|
-
);
|
|
367
|
-
return function (t) {
|
|
368
|
-
return n.apply(this, arguments);
|
|
369
|
-
};
|
|
370
|
-
})()
|
|
371
|
-
)
|
|
372
|
-
)
|
|
373
|
-
)
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
}, n);
|
|
377
|
-
})
|
|
378
|
-
);
|
|
379
|
-
return function (t) {
|
|
380
|
-
return n.apply(this, arguments);
|
|
381
|
-
};
|
|
382
|
-
})(),
|
|
383
|
-
I = function (t, n) {
|
|
384
|
-
var r = e(new v(t));
|
|
385
|
-
return (
|
|
386
|
-
r.use(h(n)),
|
|
387
|
-
r.use(k()),
|
|
388
|
-
r.use(D()),
|
|
389
|
-
r.use(P()),
|
|
390
|
-
r.use(R()),
|
|
391
|
-
r.getResult()
|
|
392
|
-
);
|
|
393
|
-
},
|
|
394
|
-
J = (function () {
|
|
395
|
-
var r = E(
|
|
396
|
-
L().m(function r(e) {
|
|
397
|
-
var o, i, u, a, c, s;
|
|
398
|
-
return L().w(function (r) {
|
|
399
|
-
for (;;)
|
|
400
|
-
switch (r.n) {
|
|
401
|
-
case 0:
|
|
402
|
-
if (((o = e.configCtx.getDoraConfig()), o.dts)) {
|
|
403
|
-
r.n = 1;
|
|
404
|
-
break;
|
|
405
|
-
}
|
|
406
|
-
return (
|
|
407
|
-
p.log(
|
|
408
|
-
'dts',
|
|
409
|
-
'skip',
|
|
410
|
-
'未配置 dts 相关配置, 跳过打包类型声明文件'
|
|
411
|
-
),
|
|
412
|
-
r.a(2)
|
|
413
|
-
);
|
|
414
|
-
case 1:
|
|
415
|
-
if (
|
|
416
|
-
((i = e.rollupOptions.input),
|
|
417
|
-
(u = e.rollupOutputList[0].file),
|
|
418
|
-
n(i || '')
|
|
419
|
-
.toLowerCase()
|
|
420
|
-
.includes('ts'))
|
|
421
|
-
) {
|
|
422
|
-
r.n = 2;
|
|
423
|
-
break;
|
|
424
|
-
}
|
|
425
|
-
return (
|
|
426
|
-
p.log(
|
|
427
|
-
'dts ',
|
|
428
|
-
'skip',
|
|
429
|
-
'类型声明文件入口 '.concat(
|
|
430
|
-
i,
|
|
431
|
-
' 不是 .ts 或 .tsx 结尾, 跳过打包类型声明文件'
|
|
432
|
-
)
|
|
433
|
-
),
|
|
434
|
-
r.a(2)
|
|
435
|
-
);
|
|
436
|
-
case 2:
|
|
437
|
-
return (
|
|
438
|
-
p.log('dts ', 'init', '开始打包类型声明文件'),
|
|
439
|
-
(a = e.rollupOutputList[0]),
|
|
440
|
-
(c = new O(e.rollupOptions)),
|
|
441
|
-
(r.n = 3),
|
|
442
|
-
c.input()
|
|
443
|
-
);
|
|
444
|
-
case 3:
|
|
445
|
-
return (
|
|
446
|
-
(s = r.v),
|
|
447
|
-
r.a(
|
|
448
|
-
2,
|
|
449
|
-
s.output(a).then(function () {
|
|
450
|
-
p.info(
|
|
451
|
-
'dts',
|
|
452
|
-
'success',
|
|
453
|
-
'输出类型 => ts;',
|
|
454
|
-
'路径 =>'.concat(t(d(), u))
|
|
455
|
-
);
|
|
456
|
-
})
|
|
457
|
-
)
|
|
458
|
-
);
|
|
459
|
-
}
|
|
460
|
-
}, r);
|
|
461
|
-
})
|
|
462
|
-
);
|
|
463
|
-
return function (t) {
|
|
464
|
-
return r.apply(this, arguments);
|
|
465
|
-
};
|
|
466
|
-
})(),
|
|
467
|
-
K = (function () {
|
|
468
|
-
var t = E(
|
|
469
|
-
L().m(function t(n, r) {
|
|
470
|
-
var e, o;
|
|
471
|
-
return L().w(function (t) {
|
|
472
|
-
for (;;)
|
|
473
|
-
switch (t.n) {
|
|
474
|
-
case 0:
|
|
475
|
-
return (
|
|
476
|
-
p.log('build', 'init', '开始打包'),
|
|
477
|
-
(e = H),
|
|
478
|
-
(t.n = 1),
|
|
479
|
-
B(n, r)
|
|
480
|
-
);
|
|
481
|
-
case 1:
|
|
482
|
-
return ((t.n = 2), e(t.v));
|
|
483
|
-
case 2:
|
|
484
|
-
return ((o = J), (t.n = 3), I(n, r));
|
|
485
|
-
case 3:
|
|
486
|
-
return ((t.n = 4), o(t.v));
|
|
487
|
-
case 4:
|
|
488
|
-
p.info('build', 'all_end', '打包完成', '🎉🎉🎉');
|
|
489
|
-
case 5:
|
|
490
|
-
return t.a(2);
|
|
491
|
-
}
|
|
492
|
-
}, t);
|
|
493
|
-
})
|
|
494
|
-
);
|
|
495
|
-
return function (n, r) {
|
|
496
|
-
return t.apply(this, arguments);
|
|
497
|
-
};
|
|
498
|
-
})(),
|
|
499
|
-
M = (function () {
|
|
500
|
-
var t = E(
|
|
501
|
-
L().m(function t(n, r) {
|
|
502
|
-
var e;
|
|
503
|
-
return L().w(function (t) {
|
|
504
|
-
for (;;)
|
|
505
|
-
switch (t.n) {
|
|
506
|
-
case 0:
|
|
507
|
-
(p.log(
|
|
508
|
-
'build',
|
|
509
|
-
'start',
|
|
510
|
-
'开始执行多任务构建,共 '.concat(n.length, ' 个任务')
|
|
511
|
-
),
|
|
512
|
-
(e = 0));
|
|
513
|
-
case 1:
|
|
514
|
-
if (!(e < n.length)) {
|
|
515
|
-
t.n = 4;
|
|
516
|
-
break;
|
|
517
|
-
}
|
|
518
|
-
return ((t.n = 2), K(n[e], r));
|
|
519
|
-
case 2:
|
|
520
|
-
p.log(
|
|
521
|
-
'build',
|
|
522
|
-
'task_end',
|
|
523
|
-
'第 '
|
|
524
|
-
.concat(e + 1, ' 个任务构建结束,共 ')
|
|
525
|
-
.concat(n.length, ' 个任务')
|
|
526
|
-
);
|
|
527
|
-
case 3:
|
|
528
|
-
(e++, (t.n = 1));
|
|
529
|
-
break;
|
|
530
|
-
case 4:
|
|
531
|
-
p.info('build', 'all_end', '多任务构建结束');
|
|
532
|
-
case 5:
|
|
533
|
-
return t.a(2);
|
|
534
|
-
}
|
|
535
|
-
}, t);
|
|
536
|
-
})
|
|
537
|
-
);
|
|
538
|
-
return function (n, r) {
|
|
539
|
-
return t.apply(this, arguments);
|
|
540
|
-
};
|
|
541
|
-
})(),
|
|
542
|
-
Q = (function () {
|
|
543
|
-
var t = E(
|
|
544
|
-
L().m(function t(n) {
|
|
545
|
-
var e, o, i, u, a, c;
|
|
546
|
-
return L().w(function (t) {
|
|
547
|
-
for (;;)
|
|
548
|
-
switch (t.n) {
|
|
549
|
-
case 0:
|
|
550
|
-
return (
|
|
551
|
-
(e = {
|
|
552
|
-
workRootDir:
|
|
553
|
-
null != n && n.workRootDir
|
|
554
|
-
? r(null == n ? void 0 : n.workRootDir)
|
|
555
|
-
: process.cwd(),
|
|
556
|
-
action: 'build',
|
|
557
|
-
}),
|
|
558
|
-
(t.n = 1),
|
|
559
|
-
A(e, n, V)
|
|
560
|
-
);
|
|
561
|
-
case 1:
|
|
562
|
-
if (((o = t.v), (i = o.getDoraConfig()), (u = m(i)).length)) {
|
|
563
|
-
t.n = 2;
|
|
564
|
-
break;
|
|
565
|
-
}
|
|
566
|
-
return (p.error('init', 'error', '没有找到构建任务'), t.a(2));
|
|
567
|
-
case 2:
|
|
568
|
-
if (1 !== u.length) {
|
|
569
|
-
t.n = 3;
|
|
570
|
-
break;
|
|
571
|
-
}
|
|
572
|
-
return ((a = o.copy()).setDoraConfig(u[0]), t.a(2, K(a, e)));
|
|
573
|
-
case 3:
|
|
574
|
-
return (
|
|
575
|
-
(c = u.map(function (t) {
|
|
576
|
-
var n = o.copy();
|
|
577
|
-
return (n.setDoraConfig(t), n);
|
|
578
|
-
})),
|
|
579
|
-
t.a(2, M(c, e))
|
|
580
|
-
);
|
|
581
|
-
}
|
|
582
|
-
}, t);
|
|
583
|
-
})
|
|
584
|
-
);
|
|
585
|
-
return function (n) {
|
|
586
|
-
return t.apply(this, arguments);
|
|
587
|
-
};
|
|
588
|
-
})(),
|
|
589
|
-
U = G(G({}, F), {}, { clear: !1, minimize: !1 }),
|
|
590
|
-
W = function (t, n) {
|
|
591
|
-
var r = e(new v(t));
|
|
592
|
-
return (
|
|
593
|
-
r.use(h(n)),
|
|
594
|
-
r.use(w()),
|
|
595
|
-
r.use(_()),
|
|
596
|
-
r.use(y()),
|
|
597
|
-
r.use(b()),
|
|
598
|
-
r.use(g()),
|
|
599
|
-
r.use(C()),
|
|
600
|
-
r.getResult()
|
|
601
|
-
);
|
|
602
|
-
},
|
|
603
|
-
X = (function () {
|
|
604
|
-
var t = E(
|
|
605
|
-
L().m(function t(n) {
|
|
606
|
-
var r, e;
|
|
607
|
-
return L().w(function (t) {
|
|
608
|
-
for (;;)
|
|
609
|
-
switch (t.n) {
|
|
610
|
-
case 0:
|
|
611
|
-
((r = new O(n)), (e = r.watch({ logLevel: 'debug' })), S(e));
|
|
612
|
-
case 1:
|
|
613
|
-
return t.a(2);
|
|
614
|
-
}
|
|
615
|
-
}, t);
|
|
616
|
-
})
|
|
617
|
-
);
|
|
618
|
-
return function (n) {
|
|
619
|
-
return t.apply(this, arguments);
|
|
620
|
-
};
|
|
621
|
-
})(),
|
|
622
|
-
Y = (function () {
|
|
623
|
-
var t = E(
|
|
624
|
-
L().m(function t(n, r) {
|
|
625
|
-
var e, o, i, u;
|
|
626
|
-
return L().w(function (t) {
|
|
627
|
-
for (;;)
|
|
628
|
-
switch (t.n) {
|
|
629
|
-
case 0:
|
|
630
|
-
if (((e = n[0]), (o = e.getCmd()), !o.watch)) {
|
|
631
|
-
t.n = 3;
|
|
632
|
-
break;
|
|
633
|
-
}
|
|
634
|
-
return (
|
|
635
|
-
p.log(
|
|
636
|
-
'dev',
|
|
637
|
-
'watch_start',
|
|
638
|
-
'watch 模式下只会启动第一个任务,共 '.concat(
|
|
639
|
-
n.length,
|
|
640
|
-
' 个任务'
|
|
641
|
-
)
|
|
642
|
-
),
|
|
643
|
-
(t.n = 1),
|
|
644
|
-
W(e, r)
|
|
645
|
-
);
|
|
646
|
-
case 1:
|
|
647
|
-
return (
|
|
648
|
-
(i = t.v).updateEnvParams(r),
|
|
649
|
-
(t.n = 2),
|
|
650
|
-
X(i.rollupOptions)
|
|
651
|
-
);
|
|
652
|
-
case 2:
|
|
653
|
-
return t.a(2);
|
|
654
|
-
case 3:
|
|
655
|
-
(p.log(
|
|
656
|
-
'dev',
|
|
657
|
-
'start',
|
|
658
|
-
'开始执行多任务构建,共 '.concat(n.length, ' 个任务')
|
|
659
|
-
),
|
|
660
|
-
(u = 0));
|
|
661
|
-
case 4:
|
|
662
|
-
if (!(u < n.length)) {
|
|
663
|
-
t.n = 7;
|
|
664
|
-
break;
|
|
665
|
-
}
|
|
666
|
-
return ((t.n = 5), K(n[u], r));
|
|
667
|
-
case 5:
|
|
668
|
-
p.log(
|
|
669
|
-
'dev',
|
|
670
|
-
'task_end',
|
|
671
|
-
'第 '
|
|
672
|
-
.concat(u + 1, ' 个任务构建结束,共 ')
|
|
673
|
-
.concat(n.length, ' 个任务')
|
|
674
|
-
);
|
|
675
|
-
case 6:
|
|
676
|
-
(u++, (t.n = 4));
|
|
677
|
-
break;
|
|
678
|
-
case 7:
|
|
679
|
-
p.info('dev', 'all_end', '多任务构建结束');
|
|
680
|
-
case 8:
|
|
681
|
-
return t.a(2);
|
|
682
|
-
}
|
|
683
|
-
}, t);
|
|
684
|
-
})
|
|
685
|
-
);
|
|
686
|
-
return function (n, r) {
|
|
687
|
-
return t.apply(this, arguments);
|
|
688
|
-
};
|
|
689
|
-
})(),
|
|
690
|
-
Z = (function () {
|
|
691
|
-
var t = E(
|
|
692
|
-
L().m(function t(n, r) {
|
|
693
|
-
var e, o;
|
|
694
|
-
return L().w(function (t) {
|
|
695
|
-
for (;;)
|
|
696
|
-
switch (t.n) {
|
|
697
|
-
case 0:
|
|
698
|
-
if (((e = n.getCmd()), !e.watch)) {
|
|
699
|
-
t.n = 3;
|
|
700
|
-
break;
|
|
701
|
-
}
|
|
702
|
-
return ((t.n = 1), W(n, r));
|
|
703
|
-
case 1:
|
|
704
|
-
return ((o = t.v), (t.n = 2), X(o.rollupOptions));
|
|
705
|
-
case 2:
|
|
706
|
-
case 4:
|
|
707
|
-
return t.a(2);
|
|
708
|
-
case 3:
|
|
709
|
-
return ((t.n = 4), K(n, r));
|
|
710
|
-
}
|
|
711
|
-
}, t);
|
|
712
|
-
})
|
|
713
|
-
);
|
|
714
|
-
return function (n, r) {
|
|
715
|
-
return t.apply(this, arguments);
|
|
716
|
-
};
|
|
717
|
-
})(),
|
|
718
|
-
$ = (function () {
|
|
719
|
-
var t = E(
|
|
720
|
-
L().m(function t(n) {
|
|
721
|
-
var e, o, i, u, a, c;
|
|
722
|
-
return L().w(function (t) {
|
|
723
|
-
for (;;)
|
|
724
|
-
switch (t.n) {
|
|
725
|
-
case 0:
|
|
726
|
-
return (
|
|
727
|
-
(e = (n || {}).watch),
|
|
728
|
-
(o = {
|
|
729
|
-
workRootDir:
|
|
730
|
-
null != n && n.workRootDir
|
|
731
|
-
? r(null == n ? void 0 : n.workRootDir)
|
|
732
|
-
: process.cwd(),
|
|
733
|
-
action: e ? 'watch' : 'dev',
|
|
734
|
-
}),
|
|
735
|
-
(t.n = 1),
|
|
736
|
-
A(o, n, U)
|
|
737
|
-
);
|
|
738
|
-
case 1:
|
|
739
|
-
if (((i = t.v), (u = i.getDoraConfig()), (a = m(u)).length)) {
|
|
740
|
-
t.n = 2;
|
|
741
|
-
break;
|
|
742
|
-
}
|
|
743
|
-
return (p.error('init', 'error', '没有找到构建任务'), t.a(2));
|
|
744
|
-
case 2:
|
|
745
|
-
if (1 !== a.length) {
|
|
746
|
-
t.n = 3;
|
|
747
|
-
break;
|
|
748
|
-
}
|
|
749
|
-
return t.a(2, Z(i, o));
|
|
750
|
-
case 3:
|
|
751
|
-
return (
|
|
752
|
-
(c = a.map(function (t) {
|
|
753
|
-
var n = i.copy();
|
|
754
|
-
return (n.setDoraConfig(t), n);
|
|
755
|
-
})),
|
|
756
|
-
t.a(2, Y(c, o))
|
|
757
|
-
);
|
|
758
|
-
}
|
|
759
|
-
}, t);
|
|
760
|
-
})
|
|
761
|
-
);
|
|
762
|
-
return function (n) {
|
|
763
|
-
return t.apply(this, arguments);
|
|
764
|
-
};
|
|
765
|
-
})(),
|
|
766
|
-
tt = {
|
|
767
|
-
name: '@doracli/rollup-node',
|
|
768
|
-
usage: 'drn <command> [option]',
|
|
769
|
-
version: '0.0.3',
|
|
770
|
-
childCommands: [
|
|
771
|
-
{
|
|
772
|
-
command: 'dev',
|
|
773
|
-
description: 'run a project by dev',
|
|
774
|
-
options: [
|
|
775
|
-
{
|
|
776
|
-
name: 'watch',
|
|
777
|
-
simpleName: 'w',
|
|
778
|
-
type: '[boolean]',
|
|
779
|
-
description: 'set output module type',
|
|
780
|
-
defaultValue: !1,
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
name: 'format',
|
|
784
|
-
simpleName: 'f',
|
|
785
|
-
type: "<'amd','cjs','es','iife','system','umd','commonjs','esm','module','systemjs'>",
|
|
786
|
-
description: 'set output module type',
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
name: 'workRootDir',
|
|
790
|
-
simpleName: 'r',
|
|
791
|
-
type: '[string]',
|
|
792
|
-
description: 'set work root path',
|
|
793
|
-
defaultValue: './',
|
|
794
|
-
},
|
|
795
|
-
],
|
|
796
|
-
action: function (t) {
|
|
797
|
-
$(t);
|
|
798
|
-
},
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
command: 'build',
|
|
802
|
-
description: 'build a project by dev',
|
|
803
|
-
options: [
|
|
804
|
-
{
|
|
805
|
-
name: 'format',
|
|
806
|
-
simpleName: 'f',
|
|
807
|
-
type: '<"amd","cjs","es","iife","system","umd","commonjs","esm","module","systemjs">',
|
|
808
|
-
description: 'set output module type',
|
|
809
|
-
},
|
|
810
|
-
{
|
|
811
|
-
name: 'workRootDir',
|
|
812
|
-
simpleName: 'r',
|
|
813
|
-
type: '[string]',
|
|
814
|
-
description: 'set work root path',
|
|
815
|
-
defaultValue: './',
|
|
816
|
-
},
|
|
817
|
-
],
|
|
818
|
-
action: function (t) {
|
|
819
|
-
Q(t);
|
|
820
|
-
},
|
|
821
|
-
},
|
|
822
|
-
],
|
|
823
|
-
};
|
|
824
|
-
export {
|
|
825
|
-
Q as buildEntry,
|
|
826
|
-
M as buildMultiple,
|
|
827
|
-
K as buildSingle,
|
|
828
|
-
tt as commandOptions,
|
|
829
|
-
$ as devEntry,
|
|
830
|
-
Z as devSingle,
|
|
831
|
-
};
|
|
1
|
+
import{relative as t,extname as n,resolve as r}from"path";import{configCtxWorkflow as e,ConfigCtx as o,collectBaseConfigMw as i,collectPackageJsonMw as u,collectTsconfigJsonMw as a,collectDoraConfigMw as c,wholeDoraConfigMw as s,wholeDoraInoutMw as f,clearMw as l,cLog as p,splitDoraCliConfig as m}from"@doracli/helper";import{getCwd as d}from"@dorabag/file-pro";import{Ctx as v,envParamsMw as h,rollupInoutMw as w,rollupExternalMw as y,rollupReactPluginMw as b,insertTsMw as g,Compiler as O,getOutputRuntime as j,rollupInputMw as k,rollupDtsInoutMw as D,rollupDtsExternalMw as P,rollupDtsPluginMw as R,rollupWatchMw as _,rollupWatchOutputMw as C,rollupWatchLog as S}from"@doracli/rollup";function x(t,n,r,e,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?n(c):Promise.resolve(c).then(e,o)}function E(t){return function(){var n=this,r=arguments;return new Promise(function(e,o){var i=t.apply(n,r);function u(t){x(i,e,o,u,a,"next",t)}function a(t){x(i,e,o,u,a,"throw",t)}u(void 0)})}}function N(t,n,r){return(n=function(t){var n=function(t,n){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,n);if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:n+""}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function T(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,e)}return r}function G(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?T(Object(r),!0).forEach(function(n){N(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function L(){
|
|
2
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
+
var t,n,r="function"==typeof Symbol?Symbol:{},e=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,e,o,i){var c=e&&e.prototype instanceof a?e:a,s=Object.create(c.prototype);return z(s,"_invoke",function(r,e,o){var i,a,c,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(n,r){return i=n,a=0,c=t,p.n=r,u}};function m(r,e){for(a=r,c=e,n=0;!l&&s&&!o&&n<f.length;n++){var o,i=f[n],m=p.p,d=i[2];r>3?(o=d===e)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=m&&((o=r<2&&m<i[1])?(a=0,p.v=e,p.n=i[1]):m<d&&(o=r<3||i[0]>e||e>d)&&(i[4]=r,i[5]=e,p.n=d,a=0))}if(o||r>1)return u;throw l=!0,e}return function(o,f,d){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&m(f,d),a=f,c=d;(n=a<2?t:c)||!l;){i||(a?a<3?(a>1&&(p.n=-1),m(a,c)):p.n=c:p.v=c);try{if(s=2,i){if(a||(o="next"),n=i[o]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((n=(l=p.n<0)?c:r.call(e,p))!==u)break}catch(n){i=t,a=1,c=n}finally{s=1}}return{value:n,done:l}}}(r,o,i),!0),s}var u={};function a(){}function c(){}function s(){}n=Object.getPrototypeOf;var f=[][e]?n(n([][e]())):(z(n={},e,function(){return this}),n),l=s.prototype=a.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,z(t,o,"GeneratorFunction")),t.prototype=Object.create(l),t}return c.prototype=s,z(l,"constructor",s),z(s,"constructor",c),c.displayName="GeneratorFunction",z(s,o,"GeneratorFunction"),z(l),z(l,o,"Generator"),z(l,e,function(){return this}),z(l,"toString",function(){return"[object Generator]"}),(L=function(){return{w:i,m:p}})()}function z(t,n,r,e){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}z=function(t,n,r,e){function i(n,r){z(t,n,function(t){return this._invoke(n,r,t)})}n?o?o(t,n,{value:r,enumerable:!e,configurable:!e,writable:!e}):t[n]=r:(i("next",0),i("throw",1),i("return",2))},z(t,n,r,e)}var F={multiple:!1,output:{path:"./lib"},formatList:["cjs","esm"],alias:{},externals:[],internals:[],minimize:!0,clear:!1,copy:[],dts:{}},V=G(G({},F),{},{minimize:!0,clear:!0}),q={dev:"development",build:"production",watch:"development"},A=function(){var t=E(L().m(function t(n,r,p){var m;return L().w(function(t){for(;;)switch(t.n){case 0:return(m=e(new o)).use(i(n.workRootDir,r)),m.use(u()),m.use(a()),m.use(c(q[n.action])),m.use(s(p)),m.use(f()),m.use(l()),t.n=1,m.getResult();case 1:return t.a(2,t.v)}},t)}));return function(n,r,e){return t.apply(this,arguments)}}(),B=function(t,n){var r=e(new v(t));return r.use(h(n)),r.use(w()),r.use(y()),r.use(b()),r.use(g()),r.getResult()},H=function(){var n=E(L().m(function n(r){var e,o,i,u;return L().w(function(n){for(;;)switch(n.n){case 0:return e=r.rollupOutputList,o=e.length>1,i=new O(r.rollupOptions),n.n=1,i.input();case 1:return u=n.v,n.a(2,Promise.all(e.map(function(){var n=E(L().m(function n(e){var i;return L().w(function(n){for(;;)if(0===n.n)return i=j(e,o,r.envParams.workRootDir),n.a(2,u.output(i).then(function(){p.info("build","success","输出类型 => ".concat(i.format,";"),"路径 =>".concat(t(d(),i.file)))}))},n)}));return function(t){return n.apply(this,arguments)}}())))}},n)}));return function(t){return n.apply(this,arguments)}}(),I=function(t,n){var r=e(new v(t));return r.use(h(n)),r.use(k()),r.use(D()),r.use(P()),r.use(R()),r.getResult()},J=function(){var r=E(L().m(function r(e){var o,i,u,a,c,s;return L().w(function(r){for(;;)switch(r.n){case 0:if(o=e.configCtx.getDoraConfig(),o.dts){r.n=1;break}return p.log("dts","skip","未配置 dts 相关配置, 跳过打包类型声明文件"),r.a(2);case 1:if(i=e.rollupOptions.input,u=e.rollupOutputList[0].file,n(i||"").toLowerCase().includes("ts")){r.n=2;break}return p.log("dts ","skip","类型声明文件入口 ".concat(i," 不是 .ts 或 .tsx 结尾, 跳过打包类型声明文件")),r.a(2);case 2:return p.log("dts ","init","开始打包类型声明文件"),a=e.rollupOutputList[0],c=new O(e.rollupOptions),r.n=3,c.input();case 3:return s=r.v,r.a(2,s.output(a).then(function(){p.info("dts","success","输出类型 => ts;","路径 =>".concat(t(d(),u)))}))}},r)}));return function(t){return r.apply(this,arguments)}}(),K=function(){var t=E(L().m(function t(n,r){var e,o;return L().w(function(t){for(;;)switch(t.n){case 0:return p.log("build","init","开始打包"),e=H,t.n=1,B(n,r);case 1:return t.n=2,e(t.v);case 2:return o=J,t.n=3,I(n,r);case 3:return t.n=4,o(t.v);case 4:p.info("build","all_end","打包完成","🎉🎉🎉");case 5:return t.a(2)}},t)}));return function(n,r){return t.apply(this,arguments)}}(),M=function(){var t=E(L().m(function t(n,r){var e;return L().w(function(t){for(;;)switch(t.n){case 0:p.log("build","start","开始执行多任务构建,共 ".concat(n.length," 个任务")),e=0;case 1:if(!(e<n.length)){t.n=4;break}return t.n=2,K(n[e],r);case 2:p.log("build","task_end","第 ".concat(e+1," 个任务构建结束,共 ").concat(n.length," 个任务"));case 3:e++,t.n=1;break;case 4:p.info("build","all_end","多任务构建结束");case 5:return t.a(2)}},t)}));return function(n,r){return t.apply(this,arguments)}}(),Q=function(){var t=E(L().m(function t(n){var e,o,i,u,a,c;return L().w(function(t){for(;;)switch(t.n){case 0:return e={workRootDir:null!=n&&n.workRootDir?r(null==n?void 0:n.workRootDir):process.cwd(),action:"build"},t.n=1,A(e,n,V);case 1:if(o=t.v,i=o.getDoraConfig(),(u=m(i)).length){t.n=2;break}return p.error("init","error","没有找到构建任务"),t.a(2);case 2:if(1!==u.length){t.n=3;break}return(a=o.copy()).setDoraConfig(u[0]),t.a(2,K(a,e));case 3:return c=u.map(function(t){var n=o.copy();return n.setDoraConfig(t),n}),t.a(2,M(c,e))}},t)}));return function(n){return t.apply(this,arguments)}}(),U=G(G({},F),{},{clear:!1,minimize:!1}),W=function(t,n){var r=e(new v(t));return r.use(h(n)),r.use(w()),r.use(_()),r.use(y()),r.use(b()),r.use(g()),r.use(C()),r.getResult()},X=function(){var t=E(L().m(function t(n){var r,e;return L().w(function(t){for(;;)switch(t.n){case 0:r=new O(n),e=r.watch({logLevel:"debug"}),S(e);case 1:return t.a(2)}},t)}));return function(n){return t.apply(this,arguments)}}(),Y=function(){var t=E(L().m(function t(n,r){var e,o,i,u;return L().w(function(t){for(;;)switch(t.n){case 0:if(e=n[0],o=e.getCmd(),!o.watch){t.n=3;break}return p.log("dev","watch_start","watch 模式下只会启动第一个任务,共 ".concat(n.length," 个任务")),t.n=1,W(e,r);case 1:return(i=t.v).updateEnvParams(r),t.n=2,X(i.rollupOptions);case 2:return t.a(2);case 3:p.log("dev","start","开始执行多任务构建,共 ".concat(n.length," 个任务")),u=0;case 4:if(!(u<n.length)){t.n=7;break}return t.n=5,K(n[u],r);case 5:p.log("dev","task_end","第 ".concat(u+1," 个任务构建结束,共 ").concat(n.length," 个任务"));case 6:u++,t.n=4;break;case 7:p.info("dev","all_end","多任务构建结束");case 8:return t.a(2)}},t)}));return function(n,r){return t.apply(this,arguments)}}(),Z=function(){var t=E(L().m(function t(n,r){var e,o;return L().w(function(t){for(;;)switch(t.n){case 0:if(e=n.getCmd(),!e.watch){t.n=3;break}return t.n=1,W(n,r);case 1:return o=t.v,t.n=2,X(o.rollupOptions);case 2:case 4:return t.a(2);case 3:return t.n=4,K(n,r)}},t)}));return function(n,r){return t.apply(this,arguments)}}(),$=function(){var t=E(L().m(function t(n){var e,o,i,u,a,c;return L().w(function(t){for(;;)switch(t.n){case 0:return e=(n||{}).watch,o={workRootDir:null!=n&&n.workRootDir?r(null==n?void 0:n.workRootDir):process.cwd(),action:e?"watch":"dev"},t.n=1,A(o,n,U);case 1:if(i=t.v,u=i.getDoraConfig(),(a=m(u)).length){t.n=2;break}return p.error("init","error","没有找到构建任务"),t.a(2);case 2:if(1!==a.length){t.n=3;break}return t.a(2,Z(i,o));case 3:return c=a.map(function(t){var n=i.copy();return n.setDoraConfig(t),n}),t.a(2,Y(c,o))}},t)}));return function(n){return t.apply(this,arguments)}}(),tt={name:"@doracli/rollup-node",usage:"drr <command> [option]",version:"0.0.4",childCommands:[{command:"dev",description:"run a project by dev",options:[{name:"watch",simpleName:"w",type:"[boolean]",description:"set output module type",defaultValue:!1},{name:"format",simpleName:"f",type:"<'amd','cjs','es','iife','system','umd','commonjs','esm','module','systemjs'>",description:"set output module type"},{name:"workRootDir",simpleName:"r",type:"[string]",description:"set work root path",defaultValue:"./"}],action:function(t){$(t)}},{command:"build",description:"build a project by dev",options:[{name:"format",simpleName:"f",type:'<"amd","cjs","es","iife","system","umd","commonjs","esm","module","systemjs">',description:"set output module type"},{name:"workRootDir",simpleName:"r",type:"[string]",description:"set work root path",defaultValue:"./"}],action:function(t){Q(t)}}]};export{Q as buildEntry,M as buildMultiple,K as buildSingle,tt as commandOptions,$ as devEntry,Z as devSingle};
|