@cocojs/cli 0.0.1-alpha.8 → 0.0.1-alpha.9
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/dist/index.js +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -432,6 +432,10 @@ var configFileName = function configFileName(cmd) {
|
|
|
432
432
|
return env ? "config.".concat(env, ".js") : defaultConfigName;
|
|
433
433
|
};
|
|
434
434
|
|
|
435
|
+
var ValidProp;
|
|
436
|
+
(function (ValidProp) {
|
|
437
|
+
ValidProp["cocoId"] = "cocoId";
|
|
438
|
+
})(ValidProp || (ValidProp = {}));
|
|
435
439
|
function readRollup(_x) {
|
|
436
440
|
return _readRollup.apply(this, arguments);
|
|
437
441
|
} // 目前 rollup 的配置仅支持简单的自定义,后续有需求再增强
|
|
@@ -480,7 +484,7 @@ function _readRollup() {
|
|
|
480
484
|
return _readRollup.apply(this, arguments);
|
|
481
485
|
}
|
|
482
486
|
function mergeRollupConfig(config1, config2) {
|
|
483
|
-
var validKeys = [
|
|
487
|
+
var validKeys = [ValidProp.cocoId];
|
|
484
488
|
var _config1 = {};
|
|
485
489
|
var _config2 = {};
|
|
486
490
|
for (var _i = 0, _validKeys = validKeys; _i < _validKeys.length; _i++) {
|
|
@@ -488,8 +492,6 @@ function mergeRollupConfig(config1, config2) {
|
|
|
488
492
|
_config1[key] = _typeof(config1) === 'object' || config1 !== null ? config1[key] : undefined;
|
|
489
493
|
_config2[key] = _typeof(config2) === 'object' || config2 !== null ? config2[key] : undefined;
|
|
490
494
|
}
|
|
491
|
-
console.info('config', config1, config2);
|
|
492
|
-
console.info('_config', _config1, _config2);
|
|
493
495
|
return Object.assign({}, _config1, _config2);
|
|
494
496
|
}
|
|
495
497
|
function getRollupConfig() {
|
|
@@ -525,11 +527,10 @@ var build = /*#__PURE__*/function () {
|
|
|
525
527
|
return getRollupConfig();
|
|
526
528
|
case 1:
|
|
527
529
|
config = _context.v;
|
|
528
|
-
console.info('rollup config', config);
|
|
529
530
|
_context.n = 2;
|
|
530
531
|
return rollup.rollup({
|
|
531
532
|
input: path$1.join(process$1.cwd(), './src/index.ts'),
|
|
532
|
-
plugins: [cocojs(), typescript({
|
|
533
|
+
plugins: [cocojs(config[ValidProp.cocoId]), typescript({
|
|
533
534
|
compilerOptions: {
|
|
534
535
|
target: 'ESNext',
|
|
535
536
|
lib: ['dom', 'esnext'],
|