{"id":19205,"library":"babel-plugin-transform-modules-ui5","title":"babel-plugin-transform-modules-ui5","description":"An unofficial Babel plugin for transforming ES6 modules to SAP UI5 module format. Version 7.8.1 is current, with a regular release cadence following UI5 conventions. Key differentiator: it enables using modern ES6 import/export syntax in SAP UI5 projects, converting them to UI5's define() calls. A preset is recommended over direct plugin use. Requires Node >=18 and @babel/core as a peer dependency.","status":"active","version":"7.8.1","language":"javascript","source_language":"en","source_url":"https://github.com/ui5-community/babel-plugin-transform-modules-ui5","tags":["javascript","ui5","sap","sapui5","openui5","babel","babel7","babeljs","babel-plugin"],"install":[{"cmd":"npm install babel-plugin-transform-modules-ui5","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-transform-modules-ui5","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-transform-modules-ui5","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for Babel plugin execution","package":"@babel/core","optional":false}],"imports":[{"note":"ESM-only, CommonJS require not supported.","wrong":"const plugin = require('babel-plugin-transform-modules-ui5')","symbol":"default","correct":"import plugin from 'babel-plugin-transform-modules-ui5'"},{"note":"Named export for advanced usage.","wrong":"import transformModulesUI5 from 'babel-plugin-transform-modules-ui5'","symbol":"transformModulesUI5","correct":"import { transformModulesUI5 } from 'babel-plugin-transform-modules-ui5'"},{"note":"The recommended preset is at a subpath, not the default export.","wrong":"import preset from 'babel-plugin-transform-modules-ui5'","symbol":"preset","correct":"import preset from 'babel-plugin-transform-modules-ui5/preset'"}],"quickstart":{"code":"// babel.config.js\nimport plugin from 'babel-plugin-transform-modules-ui5';\nexport default {\n  plugins: [\n    [plugin, { \n      // options\n    }]\n  ]\n};","lang":"javascript","description":"Shows how to configure Babel with the plugin, importing the default export."},"warnings":[{"fix":"Upgrade to version 7.x and ensure Node >=10 (now >=18).","message":"Version 7.0.0 dropped support for Node < 10 and Babel 6.","severity":"breaking","affected_versions":"<7.0.0"},{"fix":"Use babel-preset-transform-modules-ui5 instead.","message":"Direct use of the plugin is deprecated; the preset is recommended.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Update Node to >=18 or stay on older plugin version.","message":"Version 7.8.0 requires Node >=18, breaking older Node versions.","severity":"breaking","affected_versions":"<7.8.0"},{"fix":"Install @babel/core as a devDependency.","message":"The plugin must be used with @babel/core as a peer dependency; missing it causes runtime errors.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Ensure import paths match the UI5 module IDs.","message":"Import paths in UI5 modules are case-sensitive and must match module names exactly; the plugin does not normalize paths.","severity":"gotcha","affected_versions":">=7.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install @babel/core --save-dev","cause":"@babel/core is missing from node_modules.","error":"Cannot find module '@babel/core'"},{"fix":"Use import syntax in babel.config.js (ESM).","cause":"Using CommonJS require instead of ESM import.","error":"Error: Plugin/Preset files are not allowed to export objects, only functions."},{"fix":"Ensure babel.config.js exports the plugin correctly as [plugin, options].","cause":"Incorrect Babel version or plugin not applied as a function.","error":"TypeError: Cannot read properties of undefined (reading 'call')"},{"fix":"Install the plugin package and use 'babel-plugin-transform-modules-ui5/preset' (case-sensitive).","cause":"Preset path is incorrect or package not installed.","error":"Error: The preset 'babel-plugin-transform-modules-ui5/preset' is not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}