Skip to content

Commit

Permalink
chore: vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
TwilightLogic committed Jun 13, 2024
1 parent 9a4ef3d commit ddae74b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
3 changes: 2 additions & 1 deletion infra/rooch-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2",
"vite": "^5.0.8"
"vite": "^5.0.8",
"vite-plugin-node-polyfills": "^0.22.0"
}
}
19 changes: 2 additions & 17 deletions infra/rooch-portal/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,13 @@
import path from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import { nodePolyfills } from 'vite-plugin-node-polyfills'

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

0 comments on commit ddae74b

Please sign in to comment.