@cocojs/cli 0.0.1-alpha.7 → 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 +8 -5
- package/package.json +2 -2
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,13 +484,13 @@ 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++) {
|
|
487
491
|
var key = _validKeys[_i];
|
|
488
|
-
_config1[key] = _typeof(config1)
|
|
489
|
-
_config2[key] = _typeof(config2)
|
|
492
|
+
_config1[key] = _typeof(config1) === 'object' || config1 !== null ? config1[key] : undefined;
|
|
493
|
+
_config2[key] = _typeof(config2) === 'object' || config2 !== null ? config2[key] : undefined;
|
|
490
494
|
}
|
|
491
495
|
return Object.assign({}, _config1, _config2);
|
|
492
496
|
}
|
|
@@ -523,11 +527,10 @@ var build = /*#__PURE__*/function () {
|
|
|
523
527
|
return getRollupConfig();
|
|
524
528
|
case 1:
|
|
525
529
|
config = _context.v;
|
|
526
|
-
console.info('rollup config', config);
|
|
527
530
|
_context.n = 2;
|
|
528
531
|
return rollup.rollup({
|
|
529
532
|
input: path$1.join(process$1.cwd(), './src/index.ts'),
|
|
530
|
-
plugins: [cocojs(), typescript({
|
|
533
|
+
plugins: [cocojs(config[ValidProp.cocoId]), typescript({
|
|
531
534
|
compilerOptions: {
|
|
532
535
|
target: 'ESNext',
|
|
533
536
|
lib: ['dom', 'esnext'],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocojs/cli",
|
|
3
3
|
"description": "命令行工具,支持开发和构建功能",
|
|
4
|
-
"version": "0.0.1-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.9",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"webpack-cli": "^6.0.1",
|
|
44
44
|
"webpack-dev-server": "^5.2.0",
|
|
45
45
|
"webpack-merge": "^6.0.1",
|
|
46
|
-
"@cocojs/webpack-loader-mvc": "0.0.1-alpha.1",
|
|
47
46
|
"@cocojs/type-extractor": "0.0.16",
|
|
47
|
+
"@cocojs/webpack-loader-mvc": "0.0.1-alpha.1",
|
|
48
48
|
"@cocojs/rollup-plugin-mvc": "0.0.1-alpha.4"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|