Registry / http-networking / babel-plugin-system-import-transformer

babel-plugin-system-import-transformer

JSON →
library4.0.0jsnpmunverified

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.

npm install babel-plugin-system-import-transformer
INSTALL
IMPORT
SIG · BABEL-PLUGIN-SYSTE
B
babel-plugin-system-import-transformer
http-networkingjavascriptv4.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default plugin
// In .babelrc: { "plugins": ["system-import-transformer"] }
The plugin is used via Babel configuration, not directly imported in source code.
with options
// In .babelrc: { "plugins": [["system-import-transformer", { "modules": "amd" }]] }
Options are passed as an array element after the plugin name.
CommonJS require pattern
// Not imported; transforms import() calls automatically
No runtime import; the plugin works at build time.

Shows installation, configuration, and transformation of dynamic import to UMD pattern.

// Install npm install babel-plugin-system-import-transformer // .babelrc { "plugins": ["system-import-transformer"] } // Input source: import('./utils/serializer').then(module => { console.log(module); }); // Output (simplified) uses UMD pattern with Promise wrapper.
Debug
Known issues
breakingVersion 4.0.0 requires Babel v7; not compatible with Babel v6 or v5.
fix
Use v3.x for Babel v6, v2.x for Babel <6.14, v1.x for Babel v5.
affects: >=4.0.0
gotchaPlugin transforms both import() and System.import() calls, which may conflict with other tools handling dynamic imports.
fix
Ensure no other plugin transforms the same syntax, or disable the plugin if using native import support.
affects: >=1.0.0
gotchaThe UMD output uses window global; may not work in Node.js or server-side rendering without proper global definition.
fix
Configure modules option to 'common' for Node.js targets, or define global variable.
affects: >=1.0.0
deprecatedSystem.import() is deprecated in the ECMAScript spec; prefer using import() directly.
fix
Replace System.import() with import() in source code; the plugin handles both.
affects: >=1.0.0
gotchaThe optional commonJS.useRequireEnsure option works only with Webpack; other CommonJS environments may fail.
fix
Set useRequireEnsure to false (default) for standard CommonJS, or ensure Webpack is used.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-plugin-system-import-transformer'
Plugin not installed in node_modules.
fix
Run: npm install babel-plugin-system-import-transformer --save-dev
Error: Requires Babel "7.x.x", but was loaded with "6.x.x"
Installing plugin v4.x with Babel v6.
fix
Use plugin v3.x: npm install babel-plugin-system-import-transformer@^3.0.0 --save-dev
TypeError: Cannot read property 'call' of undefined
Plugin misconfiguration in .babelrc, e.g., missing plugin name.
fix
Ensure .babelrc has correct syntax: { "plugins": ["system-import-transformer"] }
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
@babel/corerequiredRequired as a peer dependency for Babel plugin API
Agent activity
21 hits · last 30 days
node
20
OpenAI (training)
1
Resources
babel-plugin-system-import-transformer — npm install babel-plugin-system-import-transformer · libregistry