1

I am trying to use octokat.js in a web app but the library tries to load XMLHttpRequest for Node which is a bad idea in the browser.

The problem comes from a require in octokat code that is handled by webpack when it should be ignored. Code here.

How am I supposed to install and use octokat.js to use with webpack ?

Anna B
  • 5,997
  • 5
  • 40
  • 52

1 Answers1

0

While writing the question, I realise that using webpack externals seems to work:

// webpack.config.js
, externals: { xmlhttprequest: "XMLHttpRequest" }

Is there another (better) way to handle this ?

Anna B
  • 5,997
  • 5
  • 40
  • 52