You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
Internally in the fork, we seem to have an extensionFormatMap, which is somethingexactly like:
{'__proto__': null,".js": "cjs"'.cjs': 'cjs','.js': 'esm',// obviously this shouldn't be the default here, but that's a separate discussion'.mjs': 'esm'}
constpackageFormatMap=doMagicToGetThis();// ^ this would throw if any keys in the object did not match `/^\.[^\.\s]+$/`, say// ^ this would also either throw, or ignore, if any of the values// in the object were not a recognized parse goal// (ie, an existing value in `extensionFormatMap`)constactualFormatMap={ ...extensionFormatMap, ... packageFormatMap};letformat=(legacy ? legacyExtensionFormatMap : actualFormatMap)[ext];
Now, you've got a mechanism to add new extensions, override existing ones, and even set them to null, perhaps, to block them from being loaded - all per package boundary. If this were to land, I'd have no objection to a "type" or "mode" field, as either mutually exclusive sugar for this field, or, as sugar for also merging in { '.js': 'esm' }, or whichever.