require.resolve #6

Closed
nathanmacinnes opened this Issue Feb 2, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@nathanmacinnes
Owner

nathanmacinnes commented Feb 2, 2012

require.resolve should be implemented.

This is a bit more tricky than the other node globals, as it needs to resolve relative to the injectr'd file.

@0b10011

This comment has been minimized.

Show comment Hide comment
@0b10011

0b10011 Apr 11, 2013

You could implement something like this (taken from here). Then require() should work out of the box.

0b10011 commented Apr 11, 2013

You could implement something like this (taken from here). Then require() should work out of the box.

@nathanmacinnes

This comment has been minimized.

Show comment Hide comment
@nathanmacinnes

nathanmacinnes Apr 12, 2014

Owner

This is less of an issue now that other globals aren't included by default. However we should look at allowing:

injectr('file', {}, {
    require : {
        resolve : ...
    }
});

in future (unless anyone can think of a better interface), which would allow injectr to provide the require function, but the resolve function to still be added. Closing for now though.

Owner

nathanmacinnes commented Apr 12, 2014

This is less of an issue now that other globals aren't included by default. However we should look at allowing:

injectr('file', {}, {
    require : {
        resolve : ...
    }
});

in future (unless anyone can think of a better interface), which would allow injectr to provide the require function, but the resolve function to still be added. Closing for now though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment