We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1aa847f commit 6398be7Copy full SHA for 6398be7
1 file changed
lib/internal/modules/esm/get_format.js
@@ -50,7 +50,7 @@ function defaultGetFormat(url, context, defaultGetFormatUnused) {
50
} else if (parsed.protocol === 'file:') {
51
const ext = extname(parsed.pathname);
52
let format;
53
- if (ext === '.js') {
+ if (!ext || ext === '.js') {
54
format = getPackageType(parsed.href) === 'module' ? 'module' : 'commonjs';
55
} else {
56
format = extensionFormatMap[ext];
0 commit comments