Closed sapphi-red closed 1 year ago
This is a good idea, especially now that Node.js is doing syntax detection.
I'd suggest we follow Node.js and make it a full "has module syntax" flag. Ie any of export {}
or import
syntax triggers it, as well as any use of import.meta.url
.
Will leave this open as a feature request - PRs very welcome.
Currently
es-module-lexer
doesn't return any information thatexport {}
existed. https://stackblitz.com/edit/node-1bnjp9?file=package.json,index.jsIt would be useful if
es-module-lexer
could return that information. Becauseexport {}
is sometimes used to indicate that the file is written in ESM.I'm not sure how to put this information in the current API. Maybe returning -1 for
ExportSpecifier['s']
?