Skip to content

Commit 67ba418

Browse files
snuggsljharb
authored andcommitted
[Breaking] use default require.extensions collection instead of the magic Array ['.js']
Fixes #137.
1 parent b5b40ae commit 67ba418

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: bin/tape

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ if (typeof opts.require === 'string') {
1818
}
1919

2020
opts.require.forEach(function (module) {
21+
var options = { basedir: cwd, extensions: Object.keys(require.extensions) };
2122
if (module) {
2223
/* This check ensures we ignore `-r ""`, trailing `-r`, or
2324
* other silly things the user might (inadvertently) be doing.
2425
*/
25-
require(resolveModule(module, { basedir: cwd }));
26+
require(resolveModule(module, options));
2627
}
2728
});
2829

0 commit comments

Comments
 (0)