How do I use Vite path aliases in tsconfig?

231 views Asked by At

Ref: How do I use Typescript path aliases in Vite?

I know a plugin vite-tsconfig-paths. However, this plugin will use the path aliases configs in tsconfig.json, then let vite config also use it.

I want to reverse it. Just config path aliases in vite.config.ts, then tsconfig will use vite path aliases config. Because we can do some things functionally in vite.config.ts, but tsconfig.json just a JSON.

The principle is to extract path aliases info from vite.config.ts, then generate a tsconfig.paths.json. We can use "extends" in project tsconfig.json to use it.

Is there some packages that can do it?

0

There are 0 answers