diff --git a/src/fs-shim.js b/src/fs-shim.js index b41602e..470ae8a 100644 --- a/src/fs-shim.js +++ b/src/fs-shim.js @@ -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 diff --git a/src/migrations/0.21-0.22.js b/src/migrations/0.21-0.22.js index 114a465..5d270a6 100644 --- a/src/migrations/0.21-0.22.js +++ b/src/migrations/0.21-0.22.js @@ -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')