A Babel plugin that automatically converts global variable references into import statements at build time. The current stable version is 1.1.0. It has a low release cadence with no recent updates. It differs from similar plugins (like babel-plugin-import) by supporting anonymous imports for side-effect modules, dynamic path generation based on filename, and flexible declaration syntax for default, named, and mixed imports. It is widely used in Create React App setups via react-app-rewired.
npm install babel-plugin-auto-importVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic auto-import for React and Component using .babelrc configuration.
Use [["auto-import", { ... }]] instead of ["auto-import", { ... }].Use {"anonymous": ["fetch"], "path": "whatwg-fetch"}.Verify nameReplacePattern matches file extension exactly (e.g., '\\.js$').
Run `npm install --save-dev babel-plugin-auto-import` and check spelling.
Change to [["auto-import", { ... }]].Add {"default": "React", "path": "react"} to declarations.No dependency data recorded yet.