janpaepke / ScrollMagic

The javascript library for magical scroll interactions.
http://ScrollMagic.io
Other
14.9k stars 2.17k forks source link

Scrollmagic and Webpack #645

Open rpolonsky opened 7 years ago

rpolonsky commented 7 years ago

Hi guys. Why it still does not work with webpack?

That solution does not help http://stackoverflow.com/questions/35531126/how-to-use-scrollmagic-with-gsap-and-webpack

That line: import Scrollmagic from 'scrollmagic'; produces an error: window is not defined

Adding imports-loader with "define=>false" - same error with this=>window - doesn't help

I wrote config line like this imports?define=>false and like this imports-loader?define=>false and like this babel!imports?define=>false&this=>window

I've tried exports and aliases, i've got different errors trying to hack that. And it's second day in a row to be lost.

May you simply add a notice in the wiki that this freaking awesome scrollmagic does not work with unknown and so not popular webpack?

liitfr commented 7 years ago

Hi ! I would suggest you to have a look at #324
@steffenmllr offered a solution that works.

exophunk commented 7 years ago

+Bump

I thought scrollmagic is somehow the state-of-the-art for scroll animations now. But that it is not working with webpack, without some very weird hacks (that I still could not get to work) is a dealbreaker. #324 does not work.

You may rather remove the whole npm package than provide some kind of package that then still doesn't work (for two years ?!)

Or please write in the documentation "This plugin does not work with webpack if you want to use gsap", that would also be ok.

mattjbrent commented 7 years ago

To be fair @exophunk and @nucamoz this is a FREE plugin that is actually quite feature rich. Whilst I appreciate it can be frustrating when things don't just work, i'd also like to point out that Jan and team use their own free time to manage and update this plugin.

I'm not sure if you read #324 all the way to the bottom but I have found this fix to work. I also would not call this a hack, you are simply making sure that it is finding the correct URI for the resouces and then importing them into the code.

I appreciate you're frustrated but good helpful people stop caring about the libraries they maintain when many people complain without saying thank you.

Don't forget we are all human beings who love the same thing...to develop the web. The only way we can improve it is by being just a bit more considerate of other people and the effort and time they put in just because they love what they do and helping/creating for others.

that is all.