wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Support path aliases

Open sodic opened this issue 9 months ago • 3 comments

Reported in version 0.16.2

Allow users to define path aliases in their tsconfig.json files, For example:

{
  "compilerOptions": {
    "paths": {
      "@/*": ["src/*"],
      "@components/*": ["src/components/*"]
    }
  }
}

This is useful becuase:

  • Other libraries rely on it (e.g., ShadCN).
  • Users don't need to write imports as import { MyComponent } from "../../../../../../../../components"; and change them in many places whenever a files moves.

I have attempted this here: https://github.com/wasp-lang/wasp/pull/2457 I'll edit the description to properly explain the problems. Until then, use this PR as the source of truth (todo for filip: check your notes). Thanks for mentioining this, @JakeLo123!

sodic avatar Feb 17 '25 17:02 sodic