* [bug] load config from jsonfile

This commit is contained in:
Riceball LEE 2017-01-25 11:03:22 +08:00
parent e7553243e6
commit 6b8c0058e4
1 changed files with 1 additions and 1 deletions

View File

@ -208,8 +208,8 @@ function findModelDefinitions(rootDir, sources) {
}
function loadModelDefinition(rootDir, jsonFile, allFiles) {
var definition = loadConfig(jsonFile);
var basename = path.basename(jsonFile, path.extname(jsonFile));
var definition = loadConfig(basename);
definition.name = definition.name || _.upperFirst(_.camelCase(basename));
// find a matching file with a supported extension like `.js` or `.coffee`