Skip to content

Commit 97b722f

Browse files
committed
vite: add node-fetch-polyfill
1 parent 429dcbc commit 97b722f

File tree

3 files changed

+441
-353
lines changed

3 files changed

+441
-353
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
"classnames": "^2.5.1",
2121
"lodash": "^4.17.21",
2222
"lucid-cardano": "^0.10.7",
23+
"node-fetch-polyfill": "^2.0.6",
2324
"react": "^18.3.1",
2425
"react-dom": "^18.3.1",
2526
"react-icons": "^5.3.0",
27+
"rollup-plugin-node-polyfills": "^0.2.1",
2628
"use-custom-compare": "^1.4.0",
2729
"usehooks-ts": "^3.1.0"
2830
},

vite.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,11 @@ export default defineConfig({
2020
'import.meta.env.REGION': JSON.stringify(process.env.REGION),
2121
'import.meta.env.CABINET_KEY': JSON.stringify(process.env.CABINET_KEY),
2222
'import.meta.env.PERSISTENT_SESSION': JSON.stringify(process.env.PERSISTENT_SESSION),
23-
}
23+
},
24+
resolve: {
25+
alias: {
26+
'node-fetch': 'node-fetch-polyfill',
27+
buffer: 'rollup-plugin-node-polyfills/polyfills/buffer-es6',
28+
},
29+
},
2430
});

0 commit comments

Comments
 (0)