How can I make Vite and Deno path aliases cooperate?
I’m working on a project that uses both Deno and Vite, and I’m running into trouble getting their path alias systems to work together.
For example, I have an alias like
~
mapped to src/
in my Vite config, so imports like ~/integrations/query/todos.tsx
work fine in the Vite dev server. However, Vite doesn’t recognize this alias, so running or linting the code with Deno fails to resolve the same imports.
I’ve tried configuring aliases in both vite.config.ts
and deno.json
, but they don’t seem to share or respect each other’s settings.
Has anyone found a good way to keep these aliases in sync, or to make both tools recognize the same import paths?
I have created a mock repo here to showcase my problem:
https://github.com/bastianplsfix/postera/blob/main/www/deno.json
Any tips, best practices, or examples would be greatly appreciated!
Thanks in advance.GitHub
postera/www/deno.json at main · bastianplsfix/postera
Contribute to bastianplsfix/postera development by creating an account on GitHub.

2 Replies
Thanks! That worked like a charm. I wish I had found (or asked) about this sooner.