What problem does this feature solve?
- VS Code Version: 1.112.0
- OS Version: macos arm64 25.3.0
Description:
The built-in Image Preview extension does not seem to recognize path mappings defined in jsconfig.json or tsconfig.json. When using an alias like @/ inside an img tag’s src attribute, VS Code fails to load the image and displays an error, even though the path is correctly resolved by the build tool (e.g., Vite/Rsbuild/Webpack) at runtime.
What does the proposed solution look like?
Steps to Reproduce:
Configure Alias: Add a path mapping in jsconfig.json at the project root
jsconfig:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"baseUrl": "./",
"allowJs": true,
"moduleResolution": "node",
"jsx": "preserve",
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"vueCompilerOptions": {
"target": 2.7
}
}
Hover over the image tag or try to open the image side-by-side.
Observed Result: The image preview shows the error message: An error occurred while loading the image.
Expected Result: The image should preview correctly, resolving @/ to the src/ directory, similar to how JavaScript imports work.
Additional Context:
The path resolution works correctly in JS/TS import statements (Ctrl+Click navigates correctly).
The issue only occurs in template contexts (HTML/Vue
tags).

What problem does this feature solve?
Description:
The built-in Image Preview extension does not seem to recognize path mappings defined in jsconfig.json or tsconfig.json. When using an alias like @/ inside an img tag’s src attribute, VS Code fails to load the image and displays an error, even though the path is correctly resolved by the build tool (e.g., Vite/Rsbuild/Webpack) at runtime.
What does the proposed solution look like?
Steps to Reproduce:
Configure Alias: Add a path mapping in jsconfig.json at the project root
jsconfig:
Hover over the image tag or try to open the image side-by-side.
Observed Result: The image preview shows the error message: An error occurred while loading the image.
Expected Result: The image should preview correctly, resolving @/ to the src/ directory, similar to how JavaScript imports work.
Additional Context:
The path resolution works correctly in JS/TS import statements (Ctrl+Click navigates correctly).
tags).
The issue only occurs in template contexts (HTML/Vue