<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>webui/frontend/vite.config.ts - fork/gdu @ ignore</title>
<meta name="description" content="webui/frontend/vite.config.ts in fork/gdu at ignore.">
<meta property="og:title" content="webui/frontend/vite.config.ts - fork/gdu @ ignore">
<meta property="og:description" content="webui/frontend/vite.config.ts in fork/gdu at ignore.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="ignore" data-tip="98ee348e421e1e963e3d7978fde02a4b2e14f170">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/gdu</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/gdu</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Daniel Milde</span><span class="commit-message" data-commit="d672bf4fc2913734947f9f56f45134bd0493ab1e">feat: add web UI (#617)</span><span class="snapshot-sha sha" data-commit="d672bf4fc2913734947f9f56f45134bd0493ab1e">d672bf4</span><time datetime="2026-08-13T08:36:33+02:00" title="2026-08-13 08:36:33 +0200">2026-08-13</time></p>
<header class="topbar"><details class="switcher"><summary>ignore</summary><div class="menu"><strong>branches</strong><a class="current" href="/fork/gdu/ref/ignore/">ignore</a><a href="/fork/gdu/ref/master/">master</a><a href="/fork/gdu/ref/subvolume/">subvolume</a><a class="all" href="/fork/gdu/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/gdu/">gdu</a> / <a href="/fork/gdu/ref/ignore/tree/webui/">webui</a> / <a href="/fork/gdu/ref/ignore/tree/webui/frontend/">frontend</a> / <span class="cur">vite.config.ts</span></nav>
<span class="view-stats"><span>712 B</span><span>26 lines</span></span><span class="actions"><a class="raw" href="/fork/gdu/raw/8216e5ec3e4b3844244431bae8849561747d2da1/webui/frontend/vite.config.ts">raw</a></span></header>
<pre class="code src language-typescript"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-c>/// &lt;reference types=&quot;vitest/config&quot; /&gt;</a-c></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"><a-k>import</a-k> <a-p>{</a-p> <a-v>defineConfig</a-v> <a-p>}</a-p> <a-k>from</a-k> <a-s>&#39;vite&#39;</a-s><a-p>;</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text"><a-k>import</a-k> <a-v>react</a-v> <a-k>from</a-k> <a-s>&#39;@vitejs/plugin-react&#39;</a-s><a-p>;</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"><a-c>// The bundle is emitted into ../dist, which is committed and embedded into the</a-c></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"><a-c>// Gdu binary via go:embed. `base: &#39;./&#39;` keeps asset URLs relative so the SPA</a-c></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"><a-c>// works regardless of the host/port the Go server binds to.</a-c></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"><a-k>export</a-k> <a-k>default</a-k> <a-f>defineConfig</a-f><a-p>({</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">  <a-pr>plugins</a-pr>: <a-p>[</a-p><a-f>react</a-f><a-p>()],</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">  <a-pr>base</a-pr>: <a-s>&#39;./&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text">  <a-pr>build</a-pr>: <a-p>{</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text">    <a-pr>outDir</a-pr>: <a-s>&#39;../dist&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text">    <a-pr>emptyOutDir</a-pr>: <a-co>true</a-co><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">    <a-pr>chunkSizeWarningLimit</a-pr>: <a-n>1500</a-n><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">  <a-p>},</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text">  <a-pr>server</a-pr>: <a-p>{</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text">    <a-c>// For local development run: gdu --web --web-listen localhost:8080</a-c></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text">    <a-pr>proxy</a-pr>: <a-p>{</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text">      <a-s>&#39;/api&#39;</a-s>: <a-s>&#39;http://localhost:8080&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text">    <a-p>},</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text">  <a-p>},</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text">  <a-pr>test</a-pr>: <a-p>{</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text">    <a-pr>environment</a-pr>: <a-s>&#39;jsdom&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text">    <a-pr>globals</a-pr>: <a-co>true</a-co><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text">  <a-p>},</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>});</a-p></span></span></pre>
</main>
</body>
</html>
