Standard Babel preset for American Express, currently at v4.0.3. Maintained by One Amex, it provides a curated set of Babel presets and plugins for transpiling JavaScript and React applications. Includes @babel/preset-env, @babel/preset-react, and plugins for dynamic imports, class properties, export default from, optional chaining, and react-remove-prop-types (production only). Supports configuration for server-only (Node), modern browsers (n-1), and module format (ESM or CommonJS). Differentiated by its opinionated defaults tailored for American Express projects, with a focus on stability and compliance. Release cadence is irregular, with minor updates and patches as needed.
npm install babel-preset-amexVerified import paths — ran on the pinned version, not inferred.
Shows how to configure babel-preset-amex in .babelrc or babel.config.js with options for serverOnly, modern, and moduleFormat.
Update to v4.0.3 or later to use the standardized transform.
Upgrade Node to version 16 or later.
Use 'moduleFormat': 'esm' for ESM; omit or use any other string for CommonJS.
Ensure NODE_ENV is set correctly to benefit from dead code elimination.
Use 'modern': true to exclude IE 11 and other legacy browsers.
npm install --save-dev babel-preset-amex
npm install --save-dev @babel/core
Use: presets: [['amex', { ... }]] instead of presets: ['amex', { ... }]Set 'moduleFormat': 'esm' or omit/use falsy value for CommonJS.