A Babel plugin (v0.1.7, last updated 2018) that automatically transforms CommonJS require() calls to access .default for ES modules that use __esModule. Addresses Babel 6/7's breaking change where exported defaults are no longer assigned to module.exports, requiring manual .default access. Helps maintain backward compatibility in mixed ES module / CommonJS codebases. Use with caution: modifies module resolution behavior and may cause unintended side effects. Consider alternatives like using ES import syntax or newer Babel interop settings.
npm install babel-plugin-transform-require-defaultVerified import paths — ran on the pinned version, not inferred.
Configures the Babel plugin to transform require() calls, excluding certain modules, and shows the result of the transformation.
Use exclude option to skip modules that don't need default interop (e.g., lodash, React).
Ensure all affected modules set __esModule, or use exclude to skip them.
Use static require() calls if you need transformation.
Test carefully with your plugin stack, and adjust plugin ordering.
Add the module to the exclude list: exclude: ["my-module"]
Use exclude: ['lodash'] or set strict mode.
No dependency data recorded yet.