A Gatsby plugin that provides Webpack resolve aliasing for import statements, simplifying paths by mapping folders (default: all src subdirectories) to short aliases. Version 1.0.6 is the current stable release, with no active development observed since 2019. It works with Gatsby >2.0.0 and offers optional custom alias and root folder configuration. Unlike manual webpack configuration in gatsby-node.js, this plugin automates alias setup without additional boilerplate.
npm install gatsby-alias-importsVerified import paths — ran on the pinned version, not inferred.
Shows how to configure the plugin with custom aliases and use them in imports.
Set resolve.symlinks: true in gatsby-node.js via onCreateWebpackConfig if you experience cryptic import errors.
Consider migrating to native Gatsby path mapping or other maintained plugins like gatsby-plugin-alias-imports.
Use paths relative to project root, e.g., 'src/Foo' instead of '/absolute/path/to/src/Foo'.
Ensure all alias paths are relative to rootFolder, not src. Update aliases accordingly.
Add `gatsby-alias-imports` to plugins array and verify alias path is relative to root (e.g., 'src/components').
Use { resolve: `gatsby-alias-imports`, options: { ... } }.Either omit options entirely or supply an aliases object. If using default behavior, simply add `gatsby-alias-imports` as a string.