title: Buffer is not defined in React-vite
body: <p>Buffer is not defined after migrating from CRA(create react app)</p>
  <p><img src="https://i.stack.imgur.com/FbKcp.png" alt="Screenshot of error" /></p>
  <p>&quot;vite&quot;: &quot;^2.7.12&quot;</p>
  <p>I try to add plugins, add define for Buffer, but it's not work.</p>
  <pre><code>const viteConfig = defineConfig({
  /*    define: {
          &quot;Buffer&quot;: {}
      },*/
      plugins: [reactRefresh(), react()],
      build: {
          rollupOptions: {
              input: {
                  main: resolve('index.html'),
              },
          },
      },
      clearScreen: false
  });
  </code></pre>