Alias imports
Alias imports allow you to shorten and clarify file paths or modules. Instead of lengthy import paths, you can use concise, descriptive aliases. This not only makes your code cleaner but also more readable.
Define aliases
configure your tsconfig.json
or jsconfig.json
This is very useful for autocompletion purposes.
Define aliases in rasengan.config.js
rasengan.config.js
import { defineConfig } from "rasengan";
export default defineConfig({
vite: {
resolve: {
alias: [
{
find: "@components",
replacement: "./src/components",
},
{
find: "@styles",
replacement: "./src/styles",
},
{
find: "@app",
replacement: "./src/app",
},
],
},
},
});
Use aliases
import { Steps, Tabs } from "@components";
// Alias imports