upgrade react to v19, migrate from CRA to Vite, add react compiler

This commit is contained in:
Tom (plebeius.eth)
2025-03-04 17:53:05 +01:00
parent 0748673bad
commit ffe42c35ea
29 changed files with 2503 additions and 5670 deletions
+29
View File
@@ -0,0 +1,29 @@
// Polyfills for Node.js built-ins
import { Buffer } from 'buffer';
import process from 'process';
import 'isomorphic-fetch';
window.Buffer = Buffer;
window.process = process;
window.global = window;
// For ethers.js
window.process.version = ''; // Fake Node.js version
window.process.env = window.process.env || {};
// Add any missing fetch polyfill
if (!window.fetch) {
console.warn('Fetch API is not available, using polyfill');
}
// For crypto support
if (typeof window.crypto === 'undefined') {
window.crypto = {};
}
if (typeof window.crypto.getRandomValues === 'undefined') {
window.crypto.getRandomValues = function (array) {
for (let i = 0; i < array.length; i++) {
array[i] = Math.floor(Math.random() * 256);
}
};
}