prefer package.json.walnut to package.json.main
This commit is contained in:
parent
28198dda87
commit
f70f3cb390
|
@ -142,6 +142,9 @@ function getApi(pkgConf, pkgDeps, route) {
|
||||||
try {
|
try {
|
||||||
route._apipkg = require(path.join(pkgpath, 'package.json'));
|
route._apipkg = require(path.join(pkgpath, 'package.json'));
|
||||||
route._apiname = route._apipkg.name;
|
route._apiname = route._apipkg.name;
|
||||||
|
if (route._apipkg.walnut) {
|
||||||
|
pkgpath += '/' + route.apipkg.walnut;
|
||||||
|
}
|
||||||
promise = require(pkgpath).create(pkgConf, pkgDeps, myApp);
|
promise = require(pkgpath).create(pkgConf, pkgDeps, myApp);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
reject(e);
|
reject(e);
|
||||||
|
|
Loading…
Reference in New Issue