Created
April 26, 2022 07:53
-
-
Save darkoatanasovski/ed7ea7f4d7d2f174d2ebbd3540879fec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' })], | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.