diff --git a/packages/isomorphic-unfetch/index.js b/packages/isomorphic-unfetch/index.js index 98eac4e..d78c3d8 100644 --- a/packages/isomorphic-unfetch/index.js +++ b/packages/isomorphic-unfetch/index.js @@ -1,5 +1,6 @@ +function r(m){return m && m.default || m;} module.exports = global.fetch = global.fetch || ( - typeof process=='undefined' ? (require('unfetch').default || require('unfetch')) : (function(url, opts) { - return (require('node-fetch').default || require('node-fetch'))(url.replace(/^\/\//g,'https://'), opts); + typeof process=='undefined' ? r(require('unfetch')) : (function(url, opts) { + return r(require('node-fetch'))(url.replace(/^\/\//g,'https://'), opts); }) );