A Babel transform plugin (v2.0.1, stable) that converts ES2015 modules to AMD format, but only when the file contains import/export statements. Unlike the standard babel-plugin-transform-es2015-modules-amd, this lazy variant skips files without imports or exports, preventing unnecessary wrapping of plain scripts or existing AMD modules. This is particularly useful in transitional or mixed codebases (e.g., combining ES2015, existing AMD modules, and non-module scripts). The plugin is a fork of Atlassian's AMD transform and is designed for legacy projects migrating to ES modules with minimal disruption. It is not intended for pure ES2015 projects.
npm install babel-plugin-transform-es2015-modules-amd-lazyVerified import paths — ran on the pinned version, not inferred.
Shows plugin usage in babel.config.js and the effect: only files with import/export become AMD modules.
If you need all files transformed, use the standard babel-plugin-transform-es2015-modules-amd instead.
Consider using @babel/plugin-transform-modules-amd for new projects, which is better maintained.
This plugin works with ES modules in @babel/core v7; the name is legacy.
Run: npm install babel-plugin-transform-es2015-modules-amd-lazy --save-dev
Add @babel/preset-env with modules: false to your config.
Explicitly set module IDs using the 'moduleIds' option or custom resolver.