{"id":26779,"library":"babel-plugin-system-import","title":"babel-plugin-system-import-transformer","description":"Babel plugin that transforms System.import() calls (and import() since v3) into a UMD-compatible pattern using Promise. Originally for Babel 5/6, now supports Babel 7 (v4). Key differentiator: it generates a runtime pattern that works across AMD, CommonJS, and global module formats without requiring a module bundler. Stable version 1.1.5 (legacy) with newer major versions for Babel 6 (v2) and Babel 7 (v4). Automatically detects module target (amd/commonjs) and strips unnecessary format detection. Maintenance mode; consider dynamic import with webpack/rollup instead.","status":"maintenance","version":"1.1.5","language":"javascript","source_language":"en","source_url":"https://github.com/thgreasi/babel-plugin-system-import-transformer","tags":["javascript","babel","babel-plugin","system","import","transformer","UMD"],"install":[{"cmd":"npm install babel-plugin-system-import","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-system-import","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-system-import","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to use as a Babel plugin","package":"@babel/core","optional":false}],"imports":[{"note":"Plugin is CommonJS only; use require in babel.config.js","wrong":"import systemImport from 'babel-plugin-system-import-transformer'","symbol":"default export","correct":"module.exports = require('babel-plugin-system-import-transformer')"},{"note":"Plugin name in Babel config is 'system-import-transformer', not 'system-import'","wrong":"{\"plugins\": [\"system-import\"]}","symbol":"Plugin in .babelrc","correct":"{\"plugins\": [\"system-import-transformer\"]}"},{"note":"Options must be in a sub-array: [plugin, options]","wrong":"{\"plugins\": [\"system-import-transformer\", {\"commonJS\": true}]}","symbol":"Plugin with options","correct":"{\"plugins\": [[\"system-import-transformer\", {\"commonJS\": true}]]}"}],"quickstart":{"code":"// Install: npm install babel-plugin-system-import-transformer\n// In .babelrc or babel.config.js:\n{\n  \"plugins\": [\"system-import-transformer\"]\n}\n// Input:\nSystem.import('./utils/serializer').then(function(module){\n    console.log(module);\n});\n// Output:\nnew Promise(function (resolve, reject) {\n    var global = window;\n    if (typeof global.define === 'function' && global.define.amd) {\n        global.require(['utilsSerializer'], resolve, reject);\n    } else if (typeof module !== 'undefined' && (module.exports && typeof require !== 'undefined') ||\n               typeof module !== 'undefined' && (module.component && (global.require && global.require.loader === 'component'))) {\n        resolve(require('./utils/serializer'));\n    } else {\n        resolve(global['utilsSerializer']);\n    }\n}).then(function(module){\n    console.log(module);\n});","lang":"javascript","description":"Demonstrates transforming System.import() into a UMD-compatible promise pattern using the plugin."},"warnings":[{"fix":"Upgrade to v2+ if using Babel 6, or pin to v1.x for Babel 5.","message":"v2.0.0 dropped Babel 5 support; only works with Babel 6+.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Use v3.x for Babel 6, or upgrade your Babel to v7.","message":"v4.0.0 requires Babel 7; incompatible with Babel 6.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use a different plugin (e.g., babel-plugin-transform-modules-umd) for other module formats.","message":"The plugin transforms only System.import() and import() (v3+); it does not transform require() or define() calls.","severity":"gotcha","affected_versions":"*"},{"fix":"Replace System.import() with import() and use a plugin that targets dynamic imports (e.g., @babel/plugin-syntax-dynamic-import).","message":"System.import() is deprecated in modern browsers and Node.js; consider using dynamic import() instead.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install babel-plugin-system-import-transformer --save-dev` and ensure config uses \"system-import-transformer\".","cause":"Plugin not installed or misspelled in Babel config.","error":"Error: Could not find plugin \"system-import-transformer\"."},{"fix":"Install matching version: v3.x for Babel 6, v4.x for Babel 7.","cause":"Plugin version mismatch with Babel version (e.g., using v4 with Babel 6).","error":"TypeError: Cannot read property 'import' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}