-
Notifications
You must be signed in to change notification settings - Fork 26
grunticon.leader of New Version 2.1 Breaks Usage With webpack #38
Comments
While we recommend inlining the grunticon loader script, I hate a regression. Lemme see what I can do to make this better. |
ya know, i'm actually going to go back to calling this an enhancement, due to the recommendation, and we'll throw it in for 2.2. |
OK, thanks for the quick reply. I'm fine with using the workaround for now. Keep up the great work! |
@pahund Hi! I try to use grunticon with webpack. Can you show how you do it? |
I'm on version 2.2.3 and this is still not working because still - the initial call is made with "this" instead of "window"....why? |
@jefflembeck is there anything I can or @webpack can do to help you implement this? |
@TheLarkInn oh geez. https://github.com/filamentgroup/grunticon-lib/blob/master/static/grunticon.loader.js is the file that needs a change. I'd love a PR and some help testing to make sure that it works. Sorry I haven't gotten to this :( |
Moving to |
I'm using webpack to optimize my JavaScript files, including the grunticon loader.
So far, this has worked great, but when I upgraded from 1.6 to 2.1, not so much. I get a "grunticon is not defined" error.
I looked at the code of the loader and noticed that the global grunticon variable is bound to a
this
context, probably assuming thatthis
iswindow
.When
webpack
bundles the loader, this is not the case anymore. If I changethis
towindow
at the end ofgrunticon.loader.js
, it works fine again.A workaround would is to use webpack's script loader, which is meant for legacy scripts. A much nicer solution would be an option to include the grunticon loader as a CommonJS or AMD module.
The text was updated successfully, but these errors were encountered: