A Babel plugin that gives a name to AMD modules based on the module's path and package name. Version 2.32.2 is the current stable release. This plugin is maintained by Liferay and is part of the JS Toolkit ecosystem. It is specifically designed for AMD module systems, automatically generating named define() calls using package name and relative path. Unlike generic AMD plugins, it integrates with Liferay's build tooling and respects .npmbundlerrc configuration. Release cadence is irregular, with version bumps tied to the monorepo releases. Works with Babel 7+ and is intended for legacy AMD codebases or custom module systems.
npm install babel-plugin-name-amd-modulesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installation, configuration with packageName and srcPrefixes, input AMD define and transformed output with named module.
Ensure define() calls always have at least two arguments: dependencies array and factory function.
Set packageName explicitly in plugin options to avoid relying on automatic detection.
Ensure define is a global in the code being transformed; avoid importing define from another module.
Explicitly configure srcPrefixes option to include all applicable source directories.
Use extensionless module paths in define() calls (e.g., define('pkg@1.0.0/index', ...)).Run 'npm install --save-dev babel-plugin-name-amd-modules' to install the plugin.
Use '"plugins": ["name-amd-modules"]' without the 'babel-plugin-' prefix.
Set srcPrefixes option to include the directory containing the file, or ensure package.json exists and is valid.