Skip to content

Commit 6398be7

Browse files
committed
treat modules with no extension as .js
1 parent 1aa847f commit 6398be7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/internal/modules/esm/get_format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function defaultGetFormat(url, context, defaultGetFormatUnused) {
5050
} else if (parsed.protocol === 'file:') {
5151
const ext = extname(parsed.pathname);
5252
let format;
53-
if (ext === '.js') {
53+
if (!ext || ext === '.js') {
5454
format = getPackageType(parsed.href) === 'module' ? 'module' : 'commonjs';
5555
} else {
5656
format = extensionFormatMap[ext];

0 commit comments

Comments
 (0)