Fix fs-shim

This commit is contained in:
haad 2023-01-12 11:08:50 +02:00
parent e4e75098b0
commit 9892d57d67
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,9 @@
/* eslint-disable */
import where from 'wherearewe'
import { isElectronMain } from 'wherearewe'
import * as fs_ from 'fs'
export const fs = (!where.isElectronMain && (typeof window === 'object' || typeof self === 'object')) ? null : eval('import("fs")')
export const fs = (!isElectronMain && (typeof window === 'object' || typeof self === 'object'))
? null
: fs_
export default fs

View File

@ -1,5 +1,5 @@
import path from 'path'
import * as fs from '../fs-shim.js'
import fs from '../fs-shim.js'
import Cache from 'orbit-db-cache'
import Logger from 'logplease'
const logger = Logger.create('orbit-db')