Rasengan Logo
Rasengan Logo
  • Docs
  • Blog
  • Showcase
  • Support us
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit

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

ON THIS PAGE

Configure Aliases
Use Aliases
Rasengan Logo
Rasengan Logo

Resources

  • Docs
  • Packages
  • Blog
  • Showcase
  • Support us

Community

  • Github
  • X (Twitter)

Subscribe to the Newsletter

Stay informed to the news about rasengan.js including new releases, events, etc...

© 2024-2026 Rasengan Labs, All rights reserved.