Skip to content

Commit 4ec1e79

Browse files
committed
Add .json extension again to match node default
1 parent df2e3ed commit 4ec1e79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: lib/input/dependency.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ function dependencyStream(indexes, options, callback) {
3333
return !!options.external || moduleFilters.internalOnly(id);
3434
},
3535
extensions: [].concat(options.extension || [])
36-
.concat(['js', 'es6', 'jsx'])
36+
// We don't document JSON files, but we do include them in this list,
37+
// because browserify & node both support unnamed requires to .json
38+
// files: `require('foo')` can require `foo.json` automatically.
39+
.concat(['js', 'es6', 'jsx', 'json'])
3740
.map(function (ext) {
3841
return '.' + ext;
3942
}),

0 commit comments

Comments
 (0)