Skip to content

Instantly share code, notes, and snippets.

@darkoatanasovski
Created April 26, 2022 07:53
Show Gist options
  • Save darkoatanasovski/ed7ea7f4d7d2f174d2ebbd3540879fec to your computer and use it in GitHub Desktop.
Save darkoatanasovski/ed7ea7f4d7d2f174d2ebbd3540879fec to your computer and use it in GitHub Desktop.
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
import inject from '@rollup/plugin-inject'
// https://vitejs.dev/config/
export default defineConfig({
define:{
"global":{}
},
plugins: [react(), tsconfigPaths()],
build:{
rollupOptions: {
plugins: [inject({ Buffer: ['Buffer', 'Buffer'], process: 'process' })],
}
}
});
@zoan37
Copy link

zoan37 commented Jan 16, 2023

This really helped! I had to use a lowercase and uppercase buffer like: "plugins: [inject({ Buffer: ['buffer', 'Buffer'] })]" (source: vitejs/vite#6180 ) to get build working on Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment