by CMSZ
Read tsconfig.json compilerOptions.paths and resolve @/… style image paths in real time so images render in Obsidian.
Obsidian Tsconfig Alias Image Resolver
Resolve @/… style path-alias image references (from tsconfig.json compilerOptions.paths) in real time, so images render in Obsidian reading view and live preview — without modifying your notes on disk.
Why
Astro / Vite projects (e.g. Astro Paper) reference images with aliases like . Obsidian does not understand the @ alias, so the image shows as "file not found". This plugin reads the vault's tsconfig.json and rewrites those paths at render time.
Features
- Reads
compilerOptions.pathsfrom the vault-roottsconfig.json(e.g.{ "@/*": ["./src/*"] }→@/→src/). - Rewrites rendered
<img>elements and Obsidianinternal-embedplaceholders in real time (markdown post-processor +MutationObserver), in both reading view and live preview. - Never edits note files on disk — everything happens in the render layer.
- Auto-reloads when
tsconfig.jsonchanges; also provides a "Reload tsconfig aliases" command. - Non-alias relative paths that Obsidian fails to resolve are additionally tried as vault-root paths.
Install
- Build the plugin (see below).
- Copy
main.jsandmanifest.jsoninto<your-vault>/.obsidian/plugins/tsconfig-alias/. - Enable Tsconfig Alias Image Resolver in Settings → Community plugins (disable Restricted mode if needed).
Development
npm install
npm run build # bundles src/main.ts and outputs main.js to the repo root
npm run dev starts esbuild in watch mode (output goes to the repo root).
Requirements
- Obsidian v1.0+
- A
tsconfig.jsonat the vault root withcompilerOptions.paths
License
MIT
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.