1

I have an application that is built using Webpack and Babel and I'm trying to import a 3rd party library that does not do an export, additionally the 3rd party library attaches itself directly on the window object.

What do I need to do in my app in order to be be able to import The3rdPartyLib?

I've tried following the loader syntax per the webpack docs but it doesn't work:

import 3rdPartyGlobal from imports?window=>{}!exports?window.3rdPartyGlobal!3rdPartyModule
loganfsmyth
  • 156,129
  • 30
  • 331
  • 251
gxc
  • 4,946
  • 6
  • 37
  • 55
  • Take note that if you use babel, it puts ecma6 imports ahead of commonJS requires, so, it might break the order of requires in your code. – Boris Burkov Mar 21 '16 at 20:45

1 Answers1

1

Perhaps you could try a similar approach found in this other question:

Expose jquery as real window object with webpack

Community
  • 1
  • 1
Chris Dziewa
  • 190
  • 10