title: Missing components and assets in vite@2 build
body: <p>I was being able to do a functional build with vite@1 and now that I have updated my configuration and my modules to work with vite@2, some assets and components do not load correctly and have paths that do not correspond to the real absolute paths.</p>
  <p>It works perfect on dev and although I am making an app with electron, it should not be a problem since as I mentioned before the builds were good with vite@1.</p>
  <p>It is not a problem with the assets, they exist in the build folder. Seems to be a problem when they are required.</p>
  <h3>This is a more detailed issue where you can find all the error messages and screenshots:</h3>
  <p><a href="https://github.com/MangoTsing/vite-electron-quick/issues/11" rel="nofollow noreferrer">https://github.com/MangoTsing/vite-electron-quick/issues/11</a></p>
  <blockquote>
  <p>Although I don't think it has to do with electron, again. Still I put it on vite-electron-quick to rule out the possibility.</p>
  </blockquote>
  <p><strong>This is my vite config</strong>:</p>
  <pre class="lang-js prettyprint-override"><code>import { join } from 'path'
  import { UserConfig } from 'vite'
  import dotenv from 'dotenv'
  import vue from '@vitejs/plugin-vue'
  
  dotenv.config({ path: join(__dirname, '.env') })
  const root = join(__dirname, 'src/render')
  
  const config: UserConfig = {
    root,
    resolve: {
      alias: {
        '/@/': root,
      }
    },
    base: './',
    build: {
      outDir: join('../../dist/render'),
      emptyOutDir: true,
      assetsInlineLimit: 0
    },
    server: {
      port: +process.env.PORT,
    },
    plugins: [
      vue()
    ],
    optimizeDeps: {
      exclude: [
        'electron-is-dev',
        'electron-store',
      ]
    },
  }
  
  export default config
  </code></pre>
  <h2>Reproduction</h2>
  <p><a href="https://github.com/denyncrawford/mismor-guillotine" rel="nofollow noreferrer">https://github.com/denyncrawford/mismor-guillotine</a></p>
  <h2>System Info</h2>
  <ul>
  <li><code>vite</code> latest:</li>
  <li>Operating System: Windows 10 2004</li>
  <li>Node version: 15.2.0</li>
  <li>Package manager (npm) and version: 7.0.8</li>
  </ul>