Docs
Core Concepts
Configuring
Modules Aliases

Modules Aliases

To configure aliases for modules, you have to define first paths in tsconfig.json or jsconfig.json file.:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@app/*": ["src/app/*"]
    }
  }
}

This first configuration is for intellisense and code navigation. To make it work in runtime, you have to configure aliases inside the rasengan.config.js file.

rasengan.config.js
import { defineConfig } from "rasengan";
 
export default defineConfig({
  vite: {
    resolve: {
      alias: [
        {
          find: "@app",
          replacement: "./src/app",
        },
      ],
    },
  },
});

Now you can import modules using the alias:

import Home from "@app/home.page.tsx";

Learn more about Modules aliases.

Next steps

Deploying - Vercel
Logo Image