grunt-cacheinfo
Advanced tools
Comparing version 0.4.1 to 0.4.2
{ | ||
"name": "grunt-cacheinfo", | ||
"description": "cacheinfo.", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "bachi", |
@@ -23,2 +23,4 @@ # grunt-cacheinfo | ||
- 0.4.2 | ||
- `getPkgConfig` 优先从 `abc.json` 中拼。 | ||
- 0.4.1 | ||
@@ -25,0 +27,0 @@ - bugfix for `pathPrefix` missing `/`. |
@@ -144,31 +144,30 @@ /* | ||
} | ||
// 校验 abc.json 是否缺少必须字段 | ||
var errorTpl = 'abc.json 中缺少 "%s" 字段或为空,请补全后重试!', | ||
requiredKeys = ['version', 'basePath', 'baseUrl'], | ||
errorParam = ''; | ||
if (isPkgFound) { | ||
grunt.log.writeln('从 ' + config_url + ' 中读取到 ' + abc.name + ' 的配置信息'); | ||
return pkg; | ||
} else { | ||
// 校验 abc.json 是否缺少必须字段 | ||
var errorTpl = 'abc.json 中缺少 "%s" 字段或为空,请补全后重试!', | ||
requiredKeys = ['version', 'basePath', 'baseUrl'], | ||
errorParam = ''; | ||
requiredKeys.forEach(function (key) { | ||
if (!abc[key]) { | ||
errorParam = key; | ||
return; | ||
} | ||
}); | ||
requiredKeys.forEach(function (key) { | ||
if (!abc[key]) { | ||
errorParam = key; | ||
return; | ||
} | ||
}); | ||
if (errorParam) { | ||
grunt.fail.warn(util.format(errorTpl, errorParam)); | ||
return null; | ||
} else { | ||
return { | ||
name: abc.name, | ||
version: abc.version, | ||
type: 'h5', | ||
main: abc.basePath, | ||
wapUrl: 'http://h5.m.taobao.com/' + abc.baseUrl.replace(/^\//, '') | ||
}; | ||
if (errorParam) { | ||
grunt.fail.warn(util.format(errorTpl, errorParam)); | ||
if (isPkgFound) { | ||
// 降级到总控去找 | ||
grunt.log.writeln('从 ' + config_url + ' 中读取到 ' + abc.name + ' 的配置信息'); | ||
return pkg; | ||
} | ||
} else { | ||
// 优先取 abc.json 中配置 | ||
return { | ||
name: abc.name, | ||
version: abc.version, | ||
type: 'h5', | ||
main: abc.basePath, | ||
wapUrl: 'http://h5.m.taobao.com/' + abc.baseUrl.replace(/^\//, '') | ||
}; | ||
} | ||
@@ -175,0 +174,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16667
58