Skip to content

Conversation

@lightninglu10
Copy link
Contributor

Summary

  • Added comprehensive JSDoc comments to the webpack plugin's getAliasMap method
  • Documents the automatic @ alias detection fallback behavior
  • Clarifies when the fallback applies and how to override it

Changes

The webpack plugin has a fallback that auto-detects the @ alias for Next.js projects. This PR adds detailed documentation explaining:

  1. When the fallback activates:

    • Only when no @ alias is found in tsconfig.json paths
    • Only when no @ alias is found in webpack resolve.alias
    • Only when a "src" directory exists in the project root
  2. What it does:

    • Assumes Next.js convention: @/*./src/*
    • Enables imports like: import { Button } from "@/components/Button"
  3. How to override it:

    • For non-Next.js projects or custom structures
    • Use explicit tsconfig.json paths configuration
    • Example: { "compilerOptions": { "paths": { "@/*": ["./app/*"] } } }

Test Plan

  • Documentation only change, no functional changes
  • Existing behavior remains unchanged
  • The fallback continues to work as before for Next.js projects
  • Users can still override with explicit configuration

🤖 Generated with Claude Code

Add comprehensive JSDoc comments explaining the automatic @ alias detection
in the webpack plugin's getAliasMap method.

The fallback behavior:
- Only activates when no @ alias is found in tsconfig or webpack config
- Assumes Next.js convention: @/* -> ./src/*
- Requires a src directory to exist in the project root

This documentation helps users understand:
- When the auto-detection applies
- How to override it for non-Next.js projects
- The recommended approach using tsconfig.json paths

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❇️ CodePress Review Summary

👋 Hey team,

Overall the changes look great! No specific issues found.

Here's the quick rundown:

✅ Decision: APPROVE
Change is documentation-only with no impact on behavior or build; safe to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants