This commit is contained in:
16
scripts/vite-cli.mjs
Normal file
16
scripts/vite-cli.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
if (crypto.webcrypto) {
|
||||
if (typeof crypto.getRandomValues !== 'function') {
|
||||
crypto.getRandomValues = crypto.webcrypto.getRandomValues.bind(crypto.webcrypto);
|
||||
}
|
||||
|
||||
if (!globalThis.crypto || typeof globalThis.crypto.getRandomValues !== 'function') {
|
||||
Object.defineProperty(globalThis, 'crypto', {
|
||||
value: crypto.webcrypto,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await import('../node_modules/vite/bin/vite.js');
|
||||
Reference in New Issue
Block a user