crabatool 1.0.23 → 1.0.24

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/index.js CHANGED
@@ -16,6 +16,15 @@ module.exports.run = function(options) {
16
16
  // 1. 服务端构建环境,自动化,根据命令行参数,直接调用脚手架功能
17
17
  if (process.argv.length > 2) {
18
18
  var arr = [...process.argv];
19
+
20
+ // 支持根据参数传入web地址,开发环境是地址1,构建环境是地址2,而配置是写死的,通过参数灵活指定
21
+ if (arr.includes('-webPath')) {
22
+ var index = arr.indexOf('-webPath');
23
+ var webPath = arr[index + 1];
24
+ if (!webPath) throw new Error('-webPath参数缺少参数值');
25
+ config.webPath = webPath;
26
+ }
27
+
19
28
  if (arr.includes('-checkjs')) {
20
29
  return checkAllJs();
21
30
  } else if (arr.includes('-run')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tool/checkjs.js CHANGED
@@ -30,7 +30,7 @@ module.exports.start = function() {
30
30
  var stats = fs.statSync(filePath);
31
31
  if (stats.size / 1024 > fileSize) { // 大于300k的js视为大文件
32
32
  if (!blackList.includes(path.basename(filePath))) {
33
- bigList.push(`路径:${filePath} 大小:${parseInt(stats.size / 1024)}kb`);
33
+ bigList.push(`${filePath} ${parseInt(stats.size / 1024)}kb`);
34
34
  }
35
35
  }
36
36