Will
Liu

next-gpa

A simple package to generate path aliases for folders in your Next project

node

Last updated: Thu Dec 22 2022

#npm-package#path-aliases
cover image

NPM

Repo

I really love using path aliases in Next. I know it's pretty easy to add them yourself, but I figured it’d be nice to automate this.

You just run npx next-gpa and it will update your tsconfig or jsconfig with path aliases for every folder in your project! You can specify folders to ignore as well.

An alternative if you don’t want to download this package to handle this is to put all of your folders into an /src folder, and set up a path alias. That way you can use @src/components or @src/public.