forked from jsnbuchanan/crowd-funder-for-time-pwa
refactor: improve type safety and browser compatibility - Replace any types with SqlValue[] in migration system - Add browser-compatible implementations of Node.js modules (crypto, fs, path) - Update Vite config to handle Node.js module polyfills - Remove outdated migration documentation files
This commit is contained in:
18
src/utils/node-modules/fs.js
Normal file
18
src/utils/node-modules/fs.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// Minimal fs module implementation for browser
|
||||
const fs = {
|
||||
readFileSync: () => {
|
||||
throw new Error('fs.readFileSync is not supported in browser');
|
||||
},
|
||||
writeFileSync: () => {
|
||||
throw new Error('fs.writeFileSync is not supported in browser');
|
||||
},
|
||||
existsSync: () => false,
|
||||
mkdirSync: () => {},
|
||||
readdirSync: () => [],
|
||||
statSync: () => ({
|
||||
isDirectory: () => false,
|
||||
isFile: () => false
|
||||
})
|
||||
};
|
||||
|
||||
export default fs;
|
||||
Reference in New Issue
Block a user