When concating rangy with other files - rangy is undefined
I use grunt for concating (and uglifying) JS files.
Rangy is not available (=undefined) on the global window object when doing this. First I thought there was a problem when uglifying the code - but that is not the case - I commented out the uglify task and just concat the files (with useminPrepare..).
My solution for now is loading rangy over the CDN..
https://cdnjs.cloudflare.com/ajax/libs/rangy/1.3.0/rangy-core.min.js
Maybe someone can tell me what's my problem? :/
Babel adds strict mode to the compiled output. 'this' doesn't refer to the window in global scope in strict mode. You need to change the last word in each file, 'this' to 'window'.
I don't want to manually change the file, because I installed it with bower - or do you think this is the best solution?
I think the only other solution is to submit a pull request to fix the issue. http://stackoverflow.com/questions/32012589/umd-javascript-module-which-also-works-in-strict-mode. Or not have 'strict mode' anywhere in your global scope before rangy.
Babel without strict mode? https://www.npmjs.com/package/babel-preset-es2015-loose