Skip to content

Commit 7c9a8ce

Browse files
committed
fix: polyfills
1 parent 4027336 commit 7c9a8ce

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

kleros-app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"globals": "^15.12.0",
5050
"typescript": "^5.6.3",
5151
"vite": "^5.4.11",
52-
"vite-plugin-dts": "^4.3.0"
52+
"vite-plugin-dts": "^4.3.0",
53+
"vite-plugin-node-polyfills": "^0.22.0"
5354
},
5455
"dependencies": {
5556
"jose": "^5.9.6",

kleros-app/vite.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
import { resolve } from "path";
33
import { defineConfig } from "vite";
44
import dts from "vite-plugin-dts";
5+
import { nodePolyfills } from "vite-plugin-node-polyfills";
56

67
export default defineConfig({
7-
plugins: [dts({ insertTypesEntry: true })],
8+
plugins: [
9+
dts({ insertTypesEntry: true }),
10+
nodePolyfills({
11+
include: ["fs", "stream"],
12+
}),
13+
],
814
build: {
915
lib: {
1016
// Could also be a dictionary or array of multiple entry points
@@ -15,7 +21,7 @@ export default defineConfig({
1521
rollupOptions: {
1622
// make sure to externalize deps that shouldn't be bundled
1723
// into your library
18-
external: ["react", "react-dom", "viem", "wagmi", "@tanstack/react-query", "graphql", "graphql-request"],
24+
external: ["react", "react-dom", "viem", "@tanstack/react-query", "graphql", "graphql-request"],
1925
output: {
2026
// Provide global variables to use in the UMD build
2127
// for externalized deps

yarn.lock

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6709,6 +6709,7 @@ __metadata:
67096709
typescript: "npm:^5.6.3"
67106710
vite: "npm:^5.4.11"
67116711
vite-plugin-dts: "npm:^4.3.0"
6712+
vite-plugin-node-polyfills: "npm:^0.22.0"
67126713
wagmi: "npm:^2.13.0"
67136714
peerDependencies:
67146715
"@tanstack/react-query": ^5.59.20
@@ -38877,6 +38878,18 @@ __metadata:
3887738878
languageName: node
3887838879
linkType: hard
3887938880

38881+
"vite-plugin-node-polyfills@npm:^0.22.0":
38882+
version: 0.22.0
38883+
resolution: "vite-plugin-node-polyfills@npm:0.22.0"
38884+
dependencies:
38885+
"@rollup/plugin-inject": "npm:^5.0.5"
38886+
node-stdlib-browser: "npm:^1.2.0"
38887+
peerDependencies:
38888+
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0
38889+
checksum: 10/004a68987d271c04e1a7b9df38f8fca32b1e4a261b464f69895af5ea90e40cbb31e18170435613cb9f2edc735589267ff51772c8793f6f567ba2849da8d36ec4
38890+
languageName: node
38891+
linkType: hard
38892+
3888038893
"vite-plugin-svgr@npm:^4.2.0":
3888138894
version: 4.2.0
3888238895
resolution: "vite-plugin-svgr@npm:4.2.0"

0 commit comments

Comments
 (0)