Skip to content

Commit

Permalink
Add node polyfill vite plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Dec 19, 2024
1 parent c10b46e commit f47de8d
Show file tree
Hide file tree
Showing 4 changed files with 453 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/keychain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"vite": "^6.0.3",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-top-level-await": "^1.4.4",
"vite-plugin-wasm": "^3.3.0",
"vitest": "^2.1.8",
Expand Down
1 change: 0 additions & 1 deletion packages/keychain/src/hooks/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
FinalizeLoginMutation,
FinalizeRegistrationMutation,
} from "@cartridge/utils/api/cartridge";
import { Buffer } from "buffer";

import { client, ENDPOINT } from "@/utils/graphql";
import base64url from "base64url";
Expand Down
3 changes: 2 additions & 1 deletion packages/keychain/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await";
import { nodePolyfills } from "vite-plugin-node-polyfills";

export default defineConfig(({ mode }) => ({
plugins: [wasm(), topLevelAwait(), react()],
plugins: [nodePolyfills(), wasm(), topLevelAwait(), react()],
server: {
port: mode === "development" ? 3001 : undefined,
},
Expand Down
Loading

0 comments on commit f47de8d

Please sign in to comment.