Skip to content

Commit 4c1debd

Browse files
efekrsklpdeveltere
andcommitted
loader: add comment explaining text format
Co-authored-by: pdeveltere <pdeveltere@users.noreply.github.com>
1 parent deb71df commit 4c1debd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/internal/modules/esm/get_format.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ function getFileProtocolModuleFormat(url, context = { __proto__: null }, ignoreE
236236
throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
237237
}
238238

239+
// If the caller explicitly requests text format via import attributes, honor it regardless of file extension.
239240
function isExperimentalTextImport(importAttributes) {
240241
return getOptionValue('--experimental-import-text') &&
241242
importAttributes?.type === 'text';

0 commit comments

Comments
 (0)