decafjs / decaf

decaf core
MIT License
31 stars 7 forks source link

require() should handle bower.json main #1

Closed mschwartz closed 10 years ago

mschwartz commented 10 years ago

If momentjs is added to a project via bower, you require() it in decaf thus:

var moment = require('moment/moment');

In the bower_components/moment directory, is moment's bower.json, which includes a main member that evaluates to "moment.js".

So

var moment = require('moment');

Should work by loading bower.json, finding that main: "member.js" and loading moment/moment.js

mschwartz commented 10 years ago

Fixed. Handles package.json and bower.json files.