Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmod的getConfig方法在获取json的dependencies时的一个bug #97

Open
hwoarangzk opened this issue Oct 9, 2015 · 2 comments
Open

Comments

@hwoarangzk
Copy link
Contributor

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;
}
@aui
Copy link
Owner

aui commented Oct 9, 2015

能否把你的修改 Pull requests ?

@hwoarangzk
Copy link
Contributor Author

@aui 好,稍后我来搞一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants