Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Work around strange webpack behavior
Browse files Browse the repository at this point in the history
Sometimes webpack will import node-fetch with a default export property, and other times with a commonjs default export.  You never know which one you are gonna get!
  • Loading branch information
bcomnes committed Jan 31, 2019
1 parent 27f6ce3 commit 64a7822
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/open-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const get = require('lodash.get')
const set = require('lodash.set')
const queryString = require('qs')
const http = require('http')
const fetch = require('node-fetch')
const Headers = fetch.Headers
const fetch = require('node-fetch').default || require('node-fetch') // Webpack will sometimes export default exports in different places
const Headers = require('node-fetch').Headers
const camelCase = require('lodash.camelcase')
const { JSONHTTPError, TextHTTPError } = require('micro-api-client')
const debug = require('debug')('netlify:open-api')
Expand Down

0 comments on commit 64a7822

Please sign in to comment.