# Enable Remix ~/ aliased imports in Vitest

Used: vite@5.0.0, vite-tsconfig-paths@4.3.1, and @vitejs/plugin-react@4.2.1

If you're using Remix you're most likely using the `~/` alias when importing files, if you want to use [Vitest](https://vitest.dev) to test your code, this can be solved by using the `vite-tsconfig-paths` plugin for Vite/Vitest.

In your `vitest.config.ts` import the plugin and add it to the list of plugins like this:

```ts {% path="vitest.config.ts" %}
/// <reference types="vitest" />
/// <reference types="vite/client" />

import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
  plugins: [react(), tsconfigPaths()],
});
```

Now Vitest will be able to resolve the paths with `~/` in your tested files and your test itself.

