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