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.
To configure aliases for modules, you have to define first paths
in tsconfig.json
or jsconfig.json
file:
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.
javascriptimport { defineConfig } from "rasengan"; export default defineConfig({ vite: { resolve: { alias: [ { find: "@app", replacement: "./src/app", }, ], }, }, });
Now you can import modules using the alias:
typescriptimport Home from "@app/home.page.tsx";
Environment Variables
Deploy to Vercel