title: Vite proxy is fetching clientside files
body: <p>I'm trying to migrate my react project from webpack to vite and I'm facing this issue with proxies:</p>
  <p>I've configured my proxy like so:</p>
  <pre><code>      port: 8000,
        proxy: {
          '/api': {
            target: 'http://localhost:8080',
            changeOrigin: true,
          },
          '/graphql': {
            target: 'http://localhost:8080',
            changeOrigin: true,
          },
        },
      },
  </code></pre>
  <p>But if I use it like that, then vite starts requesting <code>localhost:8080/api</code> for clientside files like <code>localhost:8080/api/index.ts</code> which throws a MIME type error.</p>
  <p>What’s the cause for this behavior and how can I fix it? The <code>http-proxy</code> documentation offers no details(which is what Vite uses)</p>