CORE CONCEPTS

Modules Aliases

Configuring aliases for your modules is a great way to make your code more readable and maintainable. Rasengan.js provides a way to configure aliases for your modules via the rasengan.config.js file.

Configure Aliases

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

JSON
json{ "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
javascriptimport { defineConfig } from "rasengan"; export default defineConfig({ vite: { resolve: { alias: [ { find: "@app", replacement: "./src/app", }, ], }, }, });

Use Aliases

Now you can import modules using the alias:

app.router.ts
typescriptimport Home from "@app/home.page.tsx";
Environment Variables
Deploy to Vercel