Skip to content

Commit

Permalink
feat: polyfills for buffer etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Cygnusfear committed Oct 19, 2023
1 parent 275a603 commit 9055443
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
import { fileURLToPath } from "url";
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import nodePolyfills from "vite-plugin-node-stdlib-browser";
import rollupNodePolyFill from "rollup-plugin-node-polyfills";

export default defineConfig({
plugins: [react()],
plugins: [react(), nodePolyfills()],
server: {
port: 3000,
fs: {},
},
resolve: {
alias: {
// for TypeScript path alias import like : @/x/y/z
process: "process/browser",
stream: "stream-browserify",
zlib: "browserify-zlib",
util: "util",
buffer: "buffer",
events: "events",
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
rollupOptions: {
plugins: [rollupNodePolyFill()],
},
target: "es2022",
minify: true,
sourcemap: true,
},
optimizeDeps: {
// exclude: ["@ethersproject/hash", "wrtc"],
// include: ["js-sha3", "@ethersproject/bignumber"],
},
});

0 comments on commit 9055443

Please sign in to comment.