Resolve JSON files from extensionless parameters#20
Closed
SLaks wants to merge 1 commit intobrowserify:masterfrom
Closed
Resolve JSON files from extensionless parameters#20SLaks wants to merge 1 commit intobrowserify:masterfrom
SLaks wants to merge 1 commit intobrowserify:masterfrom
Conversation
Contributor
|
+1 |
|
👍 I've noticed that the Node docs don't mention it in the pseudocode but it is mentioned in the prose about requiring files as modules |
|
+1 |
|
wonder if there's a reason this wasn't merged :( |
ljharb
requested changes
Dec 13, 2016
| var readFileSync = opts.readFileSync || fs.readFileSync; | ||
|
|
||
| var extensions = opts.extensions || [ '.js' ]; | ||
| var extensions = opts.extensions || [ '.js', '.json' ]; |
Member
There was a problem hiding this comment.
This is missing .node - instead, could we use the keys in require.extensions, which should ensure that the array always matches the require algorithm?
(if there's a concern that browserify won't be able to handle require.extensions, then let's add .node to the list also)
| }); | ||
|
|
||
| test('JSON', function (t) { | ||
| var dir = __dirname + '/resolver'; |
Member
There was a problem hiding this comment.
this should use path.join(__dirname, 'resolver') instead
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19