esModule
- Type:
optionalesModule:boolean|"if-default-prop"
Defined in: options/output-options.ts:279
Whether to add a __esModule: true property when generating exports for non-ES formats.
This property signifies that the exported value is the namespace of an ES module and that the default export of this module corresponds to the .default property of the exported object.
true: Always add the property when using named exports mode, which is similar to what other tools do."if-default-prop": Only add the property when using named exports mode and there also is a default export. The subtle difference is that if there is no default export, consumers of the CommonJS version of your library will get all named exports as default export instead of an error orundefined.false: Never add the property even if the default export would become a property.default.
Default
ts
'if-default-prop'