import { Buffer } from 'buffer';
import * as ReactNative from 'react-native';
global.Buffer = Buffer;

if (typeof global.require === 'undefined') {
  console.log('global.require is undefined');
  global.require = (m) => {
    console.log('global.require', m);
    if (m === 'react-native') return ReactNative;
    throw new Error(`global.require shim: unsupported module "${m}"`);
  };
}
