RaveJS / rave

Zero-configuration application bootstrap and development
278 stars 8 forks source link

Modules in subdirectories aren't loaded correctly #3

Closed phated closed 10 years ago

phated commented 10 years ago

Frozen modules all exist in a src directory. There should be a way to specify where modules exist within a project.

Another solution would be to start at ./ in relation to the main module.

unscriptable commented 10 years ago

Another solution would be to start at ./ in relation to the main module.

We had tossed this idea around a bit. It sounds like the only way, atm. Fwiw, curl.js has this same issue. I had to require the domReady module as var domReady = require('curl/src/curl/domReady');. ick.

I poked around a bit and have not found a package where it's not safe to assume that the main's directory is the module root of the package. Seems like the best way.

briancavalier commented 10 years ago

Sounds like a good place to start. Should we consider also looking at directories.lib? It's allowed in both CommonJS Packages 1.1 and npm.

unscriptable commented 10 years ago

I'm not sure we can use directories.lib since npm and node ignore it. If one environment uses it and another doesn't, this would prevent code from being portable between rave and node.

briancavalier commented 10 years ago

:+1: Sounds good to me