browser-resolve
Advanced tools
Comparing version 1.1.2 to 1.1.3
12
index.js
@@ -118,8 +118,2 @@ // builtin | ||
var modules = opts.modules || {}; | ||
var shim_path = modules[id]; | ||
if (shim_path) { | ||
return cb(null, shim_path); | ||
} | ||
var base = path.dirname(opts.filename); | ||
@@ -152,2 +146,8 @@ var paths = nodeModulesPaths(base); | ||
var modules = opts.modules || {}; | ||
var shim_path = modules[id]; | ||
if (shim_path) { | ||
return cb(null, shim_path); | ||
} | ||
// our browser field resolver | ||
@@ -154,0 +154,0 @@ // if browser field is an object tho? |
{ | ||
"name": "browser-resolve", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "resolve which handles browser field support in package.json", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -172,2 +172,14 @@ var assert = require('assert'); | ||
test('override engine shim', function(done) { | ||
var parent = { | ||
filename: fixtures_dir + '/override-engine-shim/index.js', | ||
package: { main: './index.js' }, | ||
modules: { url: "wonderland" } | ||
}; | ||
resolve('url', parent, function(err, path, pkg) { | ||
assert.ifError(err); | ||
assert.equal(path, require.resolve('./fixtures/node_modules/override-engine-shim/url-browser')); | ||
done(); | ||
}); | ||
}); | ||
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
23225
519