Open hwoarangzk opened 9 years ago
if (!json) { json = { "name": 'template', "version": '1.0.0', "dependencies": { "tmodjs": "1.0.0" }, "tmodjs-config": {} }; } var targetVersion = json.dependencies.tmodjs.replace(/^~/, '');
这里如果项目本身只有devDependencies而没有dependencies时会出现tmodjs of undefined的错误。建议添加一下容错的逻辑:
if (!json.dependencies) { json.dependencies = json.devDependencies; }
能否把你的修改 Pull requests ?
@aui 好,稍后我来搞一下
这里如果项目本身只有devDependencies而没有dependencies时会出现tmodjs of undefined的错误。建议添加一下容错的逻辑: