{"id":19173,"library":"babel-plugin-system-import-transformer","title":"babel-plugin-system-import-transformer","description":"Babel plugin that transforms import() and System.import() calls into a Universal Module Definition (UMD) pattern, supporting AMD, CommonJS, and global fallback. Current stable version is 4.0.0, working with Babel v7. Previous major versions support Babel v6 (v3.x) and v5 (v2.x). It provides a polyfill for dynamic import syntax for environments that lack native support, with options for Webpack's require.ensure and module ID mapping. Released on npm under MIT license, but note that native import() support in modern bundlers may reduce its necessity.","status":"active","version":"4.0.0","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-transformer","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-system-import-transformer","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-system-import-transformer","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency for Babel plugin API","package":"@babel/core","optional":false}],"imports":[{"note":"The plugin is used via Babel configuration, not directly imported in source code.","symbol":"default plugin","correct":"// In .babelrc: { \"plugins\": [\"system-import-transformer\"] }"},{"note":"Options are passed as an array element after the plugin name.","symbol":"with options","correct":"// In .babelrc: { \"plugins\": [[\"system-import-transformer\", { \"modules\": \"amd\" }]] }"},{"note":"No runtime import; the plugin works at build time.","symbol":"CommonJS require pattern","correct":"// Not imported; transforms import() calls automatically"}],"quickstart":{"code":"// Install\nnpm install babel-plugin-system-import-transformer\n\n// .babelrc\n{\n  \"plugins\": [\"system-import-transformer\"]\n}\n\n// Input source:\nimport('./utils/serializer').then(module => {\n  console.log(module);\n});\n\n// Output (simplified) uses UMD pattern with Promise wrapper.","lang":"javascript","description":"Shows installation, configuration, and transformation of dynamic import to UMD pattern."},"warnings":[{"fix":"Use v3.x for Babel v6, v2.x for Babel <6.14, v1.x for Babel v5.","message":"Version 4.0.0 requires Babel v7; not compatible with Babel v6 or v5.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Ensure no other plugin transforms the same syntax, or disable the plugin if using native import support.","message":"Plugin transforms both import() and System.import() calls, which may conflict with other tools handling dynamic imports.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Configure modules option to 'common' for Node.js targets, or define global variable.","message":"The UMD output uses window global; may not work in Node.js or server-side rendering without proper global definition.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace System.import() with import() in source code; the plugin handles both.","message":"System.import() is deprecated in the ECMAScript spec; prefer using import() directly.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Set useRequireEnsure to false (default) for standard CommonJS, or ensure Webpack is used.","message":"The optional commonJS.useRequireEnsure option works only with Webpack; other CommonJS environments may fail.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install babel-plugin-system-import-transformer --save-dev","cause":"Plugin not installed in node_modules.","error":"Error: Cannot find module 'babel-plugin-system-import-transformer'"},{"fix":"Use plugin v3.x: npm install babel-plugin-system-import-transformer@^3.0.0 --save-dev","cause":"Installing plugin v4.x with Babel v6.","error":"Error: Requires Babel \"7.x.x\", but was loaded with \"6.x.x\""},{"fix":"Ensure .babelrc has correct syntax: { \"plugins\": [\"system-import-transformer\"] }","cause":"Plugin misconfiguration in .babelrc, e.g., missing plugin name.","error":"TypeError: Cannot read property 'call' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}