Skip to content

Commit

Permalink
fix: add plugins to vite.config
Browse files Browse the repository at this point in the history
  • Loading branch information
wendychaung committed May 31, 2024
1 parent 1d50fd3 commit 5cb5ee0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { nodePolyfills } from 'vite-plugin-node-polyfills'

import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [nodePolyfills(),react()],
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: 'globalThis'
},
// Enable esbuild polyfill plugins
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true
}),
NodeModulesPolyfillPlugin()
]
// plugins: [
// NodeGlobalsPolyfillPlugin({
// process: true,
// buffer: true
// }),
// NodeModulesPolyfillPlugin()
// ]
}
},
})

0 comments on commit 5cb5ee0

Please sign in to comment.