Skip to content

Commit

Permalink
assume extension-less scripts are js scripts. resolves nodejs#37512
Browse files Browse the repository at this point in the history
  • Loading branch information
rektide committed Feb 25, 2021
1 parent 001dc16 commit e62047f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/get_format.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function defaultGetFormat(url, context, defaultGetFormatUnused) {
} else if (parsed.protocol === 'file:') {
const ext = extname(parsed.pathname);
let format;
if (ext === '.js') {
if (ext === '.js' || ext === '') {
format = getPackageType(parsed.href) === 'module' ? 'module' : 'commonjs';
} else {
format = extensionFormatMap[ext];
Expand Down

0 comments on commit e62047f

Please sign in to comment.