babel-resolver
Advanced tools
Comparing version 0.0.17 to 0.0.18
v0.0.17 / 2016-01-03 | ||
================== | ||
v0.0.18 / 2016-01-05 | ||
==================== | ||
* v0.0.18 | ||
* search all node_modules paths | ||
* changelog | ||
* v0.0.17 | ||
@@ -6,0 +9,0 @@ * Merge pull request #3 from dotfold/fix/windows-path-separator |
@@ -1,15 +0,11 @@ | ||
var findNodeModulesPath = require('./findNodeModulesPath'); | ||
var findNodeModulesPaths = require('./findNodeModulesPaths'); | ||
var resolveModuleSource = require('./resolveModuleSource'); | ||
module.exports = function createBabelResolver() { | ||
var moduleDirsToCheck = Array.prototype.slice.call(arguments); | ||
var nodeModulesPath = findNodeModulesPath(__dirname); | ||
var nodeModulesPaths = findNodeModulesPaths(__dirname); | ||
var moduleDirsToCheck = nodeModulesPaths.concat(Array.prototype.slice.call(arguments)); | ||
var extensionsToTry = ['.js', '.json', '.jsx']; | ||
if (nodeModulesPath && moduleDirsToCheck.indexOf(nodeModulesPath) === -1) { | ||
moduleDirsToCheck.unshift(nodeModulesPath); | ||
} | ||
return function (source) { return resolveModuleSource(source, moduleDirsToCheck, extensionsToTry); }; | ||
}; | ||
{ | ||
"name": "babel-resolver", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "Resolve modules from any directory.", | ||
@@ -5,0 +5,0 @@ "main": "lib/createBabelResolver.js", |
var assert = require('assert'); | ||
var resolve = require('path').resolve; | ||
var findNodeModulesPath = require('../lib/findNodeModulesPath'); | ||
var findNodeModulesPaths = require('../lib/findNodeModulesPaths'); | ||
@@ -9,6 +9,6 @@ function getFullPath(relativePath) { | ||
describe('findNodeModulesPath()', function () { | ||
describe('findNodeModulesPaths()', function () { | ||
it('finds node_modules', function () { | ||
assert(findNodeModulesPath(__dirname) === getFullPath('../node_modules')); | ||
assert(findNodeModulesPaths(__dirname)[0] === getFullPath('../node_modules')); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14289
214