-
-
Notifications
You must be signed in to change notification settings - Fork 613
Closed
Labels
Description
Feature Use Case
Currently with the CommonJS plugin you have to choose between Node.js style interop with CommonJS or browser style interop. There is no option that can work for both making compat mutually exclusive.
Feature Proposal
The idea would be for a defaultIsModuleExports: 'compat' option which uses the pattern:
import * as m from 'cjs';
const moduleExports = m.default || m;Where the default is used if it exists, otherwise falling back to the namespace.
This might allow for compatibility with Node.js interop as well as Babel interop cases in more scenarios.