Vite by default does not support src alias like
import counterReducer from "@src/pages/counter/counter.slice";
Every time you will have to pass the full relative path like this
import counterReducer from "../../src/pages/counter/counter.slice";
Is there any way we can shorten these relative paths?
Yes, vite doesn't come with the default configuration of aliases, but you can define your own aliases.
Step: 1 Open "vite.config.js" and add your aliases.
Step 2: Open tsconfig.json or jsconfig.json and append this code under compiler options.