Absolute imports on mac and windows in Vite - React TS project

43 Views Asked by At

I am working on a Typescript React project. Now i have added the option to use absolute paths for imports, so a ../../../components would become ~/components/*. Most of our developers work on a macbook so the ~/ imports work. We have one team member who is on a Windows 10 machine and there the absolute paths don't work.

I just tried to change the ~/ to @/ but still the same problem.

        "baseUrl": "./app",
        "paths": {
            "@/*": ["*"]
            // "~/*": ["./app/*"],
        },

vite-tsconfig-paths is also added in the vite.config.ts file.

Maybe a variable PATH i can change on windows 10 to solve this issue?

I hope someone can help me out :-)

Kind regards, Jeff

0

There are 0 best solutions below