Closed securingsincity closed 9 years ago
@defunctzombie I fixed some of the things you had above.
As for why its needed, there are a few situations where you would want to resolve files that match certain criteria but you don't have the exact file name as an example from http://github.com/facebook/jest 's repo
return resolve.sync(moduleName, {
basedir: path.dirname(currPath),
extensions: this._config.moduleFileExtensions
.map(function(ext){
return '.' + ext;
})
});
Here they are trying to resolve module's by name but also in a base path. Because it's a test runner it doesn't necessarily need to run at the root of package. . There is an issue in jest https://github.com/facebook/jest/issues/61 that would be resolved by using node-browser-resolve instead of node-resolve assuming that this went through.
With that said if you don't think its necessary, I'd be happy to close the PR
Published as 1.5.0. Thanks!
Why is basedir support needed?