Skip to content

Commit 780f374

Browse files
committed
优化打包及测试脚本
1 parent 164d4df commit 780f374

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

build/build.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ function updateCommand() {
126126
var commandInput = $('#command2')[0];
127127
var deplistItems = $('#deplist li input');
128128
var modulePaths = '';
129-
for (var i = 0; i < deplistItems.length; i++) {
130-
if (deplistItems[i].checked) {
131-
modulePaths = "Core" + ','
132-
}
133-
}
129+
134130
var deplistItems2 = $('.deplist li input');
135131
for (var i = 0; i < deplistItems2.length; i++) {
136132
if (deplistItems2[i].id === "Core") {
@@ -141,7 +137,7 @@ function updateCommand() {
141137
}
142138
}
143139
modulePaths = modulePaths.substring(0, modulePaths.length - 1);
144-
commandInput.value = modulePaths === '' ? modulePaths : 'npm run package - ' + getKey() + " " + modulePaths;
140+
commandInput.value = 'npm run package - ' + getKey() + " " + modulePaths;
145141
}
146142

147143
function getKey() {

build/pack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ program
6060
}
6161
}
6262
});
63-
shell.exec('npm run deploy ' + modulePaths);
63+
shell.exec('npm run deploy-'+key+' ' + modulePaths);
6464
});
6565

6666
program.parse(process.argv);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"deploy-leaflet": "webpack --config webpack.config.leaflet.js ",
1313
"deploy-ol3": "webpack --config webpack.config.ol3.js ",
1414
"compress": "webpack -p",
15-
"package": "node ./build/pack.js"
15+
"package": "node ./build/pack.js",
16+
"test":"karma start"
1617
},
1718
"keywords": [
1819
"SuperMap",

0 commit comments

Comments
 (0)