23 lines
562 B
JavaScript
23 lines
562 B
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react-swc'
|
|
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
// Node.js global to browser globalThis
|
|
define: {
|
|
global: 'window'
|
|
},
|
|
// Enable esbuild polyfill plugins
|
|
plugins: [
|
|
NodeGlobalsPolyfillPlugin({
|
|
buffer: true
|
|
})
|
|
]
|
|
}
|
|
}
|
|
|
|
})
|