Skip to content

Commit

Permalink
Merge e3115f7 into b8582ab
Browse files Browse the repository at this point in the history
  • Loading branch information
funnylookinhat committed Jan 5, 2016
2 parents b8582ab + e3115f7 commit 24eb5f0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/app-root-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ module.exports = function(dirname) {
return path.join(appRootPath, pathToModule);
},

resolveRelative: function(pathToModule) {
if (!process.env.APP_RELATIVE_PATH) {
console.warn('APP_RELATIVE_PATH not defined!');
}
return publicInterface.resolve(path.join(process.env.APP_RELATIVE_PATH, pathToModule));
},

require: function(pathToModule) {
// Backwards compatibility check
if ('function' === typeof pathToModule) {
Expand All @@ -23,6 +30,13 @@ module.exports = function(dirname) {
return require(publicInterface.resolve(pathToModule));
},

requireRelative: function(pathToModule) {
if (!process.env.APP_RELATIVE_PATH) {
console.warn('APP_RELATIVE_PATH not defined!');
}
return publicInterface.require(path.join(process.env.APP_RELATIVE_PATH, pathToModule));
},

toString: function() {
return appRootPath;
},
Expand Down

0 comments on commit 24eb5f0

Please sign in to comment.