Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
2.1.14 breaks build with jquery 2.1.0 #704
I have a project that was using r.js v2.1.11 without problem that suddenly is having the jquery define call overloaded with a blank function when built with r.js v2.1.14.
This little guy right here is being written to the output file directly after jquery is included:
Not good. If I manually delete that, everything works as it did back with r.js v2.1.11.
Here's my config:
I am curious how this fails. While the optimizer should not write out the extra define, as long as jQuery's internal
I tried with this sample project using stock 2.1.1 and 1.11.1 jQuery and they both worked even though they had the extra define() in there.
Are you custom-building jQuery perhaps? Trying to figure out why the test case above still works while yours does not.
I'm going to put this in the 2.1.15 bucket to see about avoiding writing out the extra define, but also curious to know how I can get a project that fails instead of it just being an extra define that does nothing.
As to cause of the extra define() write, it could be related to the UMD detection that 2.1.12-2.1.14 tries to do. Possibly relevant bug, requirejs/requirejs#1133
Completely stock jQuery. That was one of the first things I tested, and went and downloaded a fresh build of jQuery v2.1.0 and added that to my project.
I didn't realize the first define should win out. I figured any subsequent define calls would overwrite the first one.
@jrburke I'm not sure if you'd concern yourself with this specific issue or not, but my issue is related to using amdclean in my project. amdclean will rewrite
Sticking with r.js v2.1.13 is my current workaround. I know you probably don't concern yourself too much with specific incompatibilities with other build tools; however, I would suggest that the added empty define() by r.js v2.1.14 is a regression needing a lookover independent of my particular issue.