Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

grunticon.leader of New Version 2.1 Breaks Usage With webpack #38

Closed
pahund opened this issue Feb 5, 2015 · 8 comments
Closed

grunticon.leader of New Version 2.1 Breaks Usage With webpack #38

pahund opened this issue Feb 5, 2015 · 8 comments
Assignees
Labels
Milestone

Comments

@pahund
Copy link

pahund commented Feb 5, 2015

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 that this is window.

When webpack bundles the loader, this is not the case anymore. If I change this to window at the end of grunticon.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.

@jefflembeck
Copy link
Collaborator

While we recommend inlining the grunticon loader script, I hate a regression. Lemme see what I can do to make this better.

@jefflembeck
Copy link
Collaborator

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.

@pahund
Copy link
Author

pahund commented Feb 9, 2015

OK, thanks for the quick reply. I'm fine with using the workaround for now. Keep up the great work!

@jiv-e
Copy link

jiv-e commented Nov 23, 2015

@pahund Hi! I try to use grunticon with webpack. Can you show how you do it?

@rvetere
Copy link

rvetere commented Jun 11, 2016

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?

@TheLarkInn
Copy link

@jefflembeck is there anything I can or @webpack can do to help you implement this?

@jefflembeck
Copy link
Collaborator

@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 :(

@zachleat zachleat self-assigned this Dec 17, 2018
@zachleat
Copy link
Member

Moving to grunticon-lib

@zachleat zachleat transferred this issue from filamentgroup/grunticon Dec 17, 2018
@zachleat zachleat added the bug label Dec 17, 2018
@zachleat zachleat added this to the v2.0.0 milestone Dec 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants