}
app/page.tsx import Button from 'components/button'
 
export default function HomePage() {
  return (
    <>
      <h1>Hello World</h1>
      <Button />
    </>
  )
}
Module Aliases
In addition to configuring the baseUrl path, you can use the "paths" option to "alias" module paths.
For example, the following configuration maps @/components/* to components/*:
tsconfig.json or jsconfig.json {
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/components/*": ["components/*"]
    }
  }
}
components/button.tsx export default function Button() {
  return <button>Click me</button>
}
app/page.tsx import Button from '@/components/button'
 
export default function HomePage() {
  return (
    <>