DenoDDeno
Powered by
SebastianS
Deno•9mo ago•
2 replies
Sebastian

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/
src/
in my Vite config, so imports like ‎
~/integrations/query/todos.tsx
~/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
vite.config.ts
and ‎
deno.json
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.
Screenshot_2025-07-04_at_15.10.35.png
GitHub
postera/www/deno.json at main · bastianplsfix/postera
Contribute to bastianplsfix/postera development by creating an account on GitHub.
postera/www/deno.json at main · bastianplsfix/postera
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Deno Aliases
BloxEZBBloxEZ / help
9mo ago
How can I replace vite with `deno bundle`?
QuillQQuill / help
9mo ago
deno+vite+tailwind
moochMmooch / help
12mo ago
Deno + Vite + DenoKV
AndiAAndi / help
2y ago