A Babel plugin that allows module imports using Webpack-like aliases and custom root directories, resolving paths similar to webpack's enhanced-resolve. Version 1.7.0 (current stable) last released in 2022 with low release cadence. It supports both custom alias configuration and automatic usage of jsconfig/tsconfig paths, making it a lightweight alternative to babel-plugin-module-resolver. Includes TypeScript types and supports ESM and CJS import patterns.
npm install babel-plugin-module-resolveNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic setup with alias configuration to simplify import paths.
Test paths thoroughly; if issues arise, use absolute paths in alias.
If upgrading from <1.0, explicitly configure alias or use tsconfig paths.
Use absolute paths in alias or set roots to an absolute path.
Add alias in plugin options: { alias: { '@utils': './src/utils' } }Check that the alias mapping is correct and the directory exists. Use absolute paths if needed.