Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement require.resolve #5

Open
deathcap opened this issue Feb 9, 2015 · 1 comment
Open

Implement require.resolve #5

deathcap opened this issue Feb 9, 2015 · 1 comment

Comments

@deathcap
Copy link
Owner

deathcap commented Feb 9, 2015

http://nodejs.org/api/all.html#all_require_resolve

require.resolve()#

Use the internal require() machinery to look up the location of a module, but rather than loading the module, just return the resolved filename.

had to stub out this function to load browserified browserify, but browserify doesn't implement it (npm doesn't need it, at least to load). Asking for the path of a module doesn't make much sense in a traditional browserify environment because all of the modules are concatenated into one bundle.js file, but it does in webnpm where modules may be present in the webfs.

@deathcap
Copy link
Owner Author

Needed in https://github.com/substack/insert-module-globals/blob/769f4bd08e01b77a620f2e2de1d2249c8311b0a2/index.js#L6-L7

var processPath = require.resolve('process/browser.js');
var isbufferPath = require.resolve('is-buffer')

deathcap added a commit to deathcap/nodeachrome that referenced this issue Apr 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant