webpack-contrib / imports-loader

Imports Loader
MIT License
520 stars 63 forks source link

Cannot find module 'imports-loader?this=>window!gsap' #29

Closed bishopZ closed 4 years ago

bishopZ commented 8 years ago

The GSAP library that I am loading requires access to the document object. I have research many solutions, but none have worked. How do I expose the document object to that plugin (or to all plugins)?

This page for instance: http://webpack.github.io/docs/shimming-modules.html explains three potential solutions. For me, each one yields a different error message.

If I write import {TimelineMax} from 'imports?this=>window!gsap'; I get the error Cannot find module 'imports?this=>window!gsap'

The problem is not unique to GSAP; it happens with every library. Imports loader is not recognized by webpack. Even though it is in package.json, has been installed, and other loaders work fine. "imports-loader": "0.6.5",

Any help appreciated.

bishopZ commented 8 years ago

I also created this stackoverflow article.

imjakechapman commented 8 years ago

I'm dealing with the same issue but with Backbone importing $ and window as well. Me and @bishopZ have been chatting about it in Webpack Gitter channel.

loriensleafs commented 7 years ago

I'm also dealing with this and Backbone.

koko236 commented 6 years ago

Hi, I seem to experience the same bug with Webpack3. Imports-loader just doesn't work for me. No time now to dig deeper, but I can try if it helps solving the issue. Is the project still alive at all?