Why do LibraryFormats declare es
instead of esm
, where as ModuleFormat define both?
#18157
Unanswered
christopher-francisco-jpmc
asked this question in
Q&A
Replies: 1 comment
-
The reason "es" is used in LibraryFormats is because it is the standard abbreviation for ECMAScript modules in Rollup. "esm" is not a format recognized by default, but is often used as a file extension. In ModuleFormat, "es" and "esm" are included because ModuleFormat supports more custom options, while LibraryFormats follows standard format identifiers like "es" and "cjs". |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order to have
{entryName}.esm.js
extension, I have to manually do string manipulationObviously I'm missing something very basic here. Is
.esm.js
not the standard extension? (see rollup wiki)Moreover, the type definition for both
formats
(LibaryrFormats
) andformat
(ModuleFormat
) in the snipped above are as follow:So both
es
andesm
can potentially be values offormat
; but onlyes
is a valid value to be passed toformats
.What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions