(id,root)
| 136 | |
| 137 | // return path to found, project first |
| 138 | function projectOrHereRequire(id,root) { |
| 139 | try { |
| 140 | return resolve.sync(id, { |
| 141 | package: path.join(root,'package.json'), |
| 142 | paths: [root], |
| 143 | basedir:root |
| 144 | }); |
| 145 | } catch(ex) { |
| 146 | // console.error(ex); |
| 147 | } |
| 148 | |
| 149 | var here = path.join(__dirname,'..','..'); |
| 150 | try { |
| 151 | var p = resolve.sync(id, { |
| 152 | package: path.join(here,'package.json'), |
| 153 | paths: [here], |
| 154 | basedir:here |
| 155 | }); |
| 156 | return p; |
| 157 | } catch(ex) { |
| 158 | // console.error(ex); |
| 159 | } |
| 160 | } |