mardi 27 janvier 2015

moment is undefined error from my Ember app's minified vendor.js

I have an Ember.js app (not ember-cli) working with grunt and bower using moment.js.


When the app runs locally, everything works fine. But when we push to production and all the dependencies get minified and concat'ed together, moment.js does not exist as a global like it normally does (Ember throws "moment is not defined"). However, if I look at vendor.js in my sources, I can see some of moment's source code (though no explicit window.moment = foo, etc.) so it's definitely making it up to production.


I've seen this problem under: moment.js moment is undefined, and have tried juking my version of moment to pre 2.4 to no avail.


Not sure how grunt compiles everything together in the build stage, but any suggestions as to how I can explicitly define moment without installing a new package manager or get around this annoying hiccup would be greatly appreciated.





Aucun commentaire:

Enregistrer un commentaire