<p dir="auto">Vendoring a project which makes use of the automatic runtime JSX transpilation leads to an error when running the project. This is because vendoring isn't aware of the JSX compiler options and skips vendoring that dependency. It should account for the value in <code class="notranslate">compilerOptions.jsxImportSource</code>. The value set there is expanded to either <code class="notranslate">&lt;value&gt;/jsx-runtime</code> or <code class="notranslate">&lt;value&gt;/jsx-dev-runtime</code> depending on whether <code class="notranslate">jsx</code> is set to <code class="notranslate">jsx-react</code> or <code class="notranslate">jsx-reactdev</code>.</p>
<p dir="auto">Error:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error: Relative import path &quot;preact/jsx-runtime&quot; not prefixed with / or ./ or ../ and not in import map from &quot;file:///projject/main.tsx&quot;
    at file:///project/main.tsx:1:1"><pre class="notranslate">error: Relative import path <span class="pl-s"><span class="pl-pds">"</span>preact/jsx-runtime<span class="pl-pds">"</span></span> not prefixed with / or ./ or ../ and not <span class="pl-k">in</span> import map from <span class="pl-s"><span class="pl-pds">"</span>file:///projject/main.tsx<span class="pl-pds">"</span></span>
    at file:///project/main.tsx:1:1</pre></div>
<h2 dir="auto">Steps to reproduce</h2>
<ol dir="auto">
<li>Clone <a href="https://github.com/marvinhagemeister/deno-vendor-jsx-runtime">https://github.com/marvinhagemeister/deno-vendor-jsx-runtime</a></li>
<li>Run <code class="notranslate">deno run main.tsx</code> which will print <code class="notranslate">&lt;h1&gt;it works&lt;/h1&gt;</code></li>
<li>Run <code class="notranslate">deno venodr main.tsx</code></li>
<li>Run <code class="notranslate">deno run --no-remote --import-map=vendor/import_map.json main.tsx</code> -&gt; Error</li>
</ol>
<p dir="auto"><code class="notranslate">deno vendor</code> does not honor jsxImportSource. It should automatically vendor code defined by <code class="notranslate">jsxImportSource</code></p>
<p dir="auto">minimal repro at <a href="https://github.com/sylc/repro_issue_deno_vendor_jsxImportSource">https://github.com/sylc/repro_issue_deno_vendor_jsxImportSource</a></p>
<p dir="auto">Note:<br>
The current work around to get it vendored correctly is to explicitly call, in the program code, the jsx source, for example adding</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { h } from &quot;preact/jsx-runtime&quot;;"><pre class="notranslate"><code class="notranslate">import { h } from "preact/jsx-runtime";
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno --version
deno 1.26.0 (release, x86_64-pc-windows-msvc)
v8 10.7.193.3
typescript 4.8.3"><pre class="notranslate"><code class="notranslate">$ deno --version
deno 1.26.0 (release, x86_64-pc-windows-msvc)
v8 10.7.193.3
typescript 4.8.3
</code></pre></div>