Search code examples
javascriptjquerybuildamd

How does jQuery concatenate its sources and gets rid of its AMD definitions


I see jQuery uses AMD in its sources. However in their concatenated dist file all AMD references are gone. How do they build their script, getting rid of the AMD and still keeping the source code functional?


Solution

  • Its using the requirejs optimizer (aka r.js) along with lots of customizations, including several regular expressions. Studying the source of the "build" grunt task will provide many more details.