Any plans to support combing modules?

Jun 9, 2014 at 1:58 PM
Hi - I need to combine modules into bundles much like requires does http://requirejs.org/docs/optimization.html. Are there any plans to support this type of feature? Thanks.
Coordinator
Jun 9, 2014 at 2:51 PM
Not sure I understand -- AjaxMin has always had the ability to combine multiple source JS files into a single minified output file. Do you mean to automatically figure out what source files need to be combined together?
Jun 10, 2014 at 6:26 PM
Consider the following scenario.

main.js file
define(["one", "two", "three"], function (one, two, three) {
});

one.js file
(function () {
console.log("one");
})()

two.js file
(function () {
console.log("two");
})()

three.js file
(function () {
console.log("three");
})()

After running r.js we end up with the following main.js file. The files have been bundled and a define statement has been added for each of the bundled files.
(function(){console.log("one")})(),define("one",function(){}),function(){console.log("two")}(),define("two",function(){}),function(){console.log("three")}(),define("three",function(){}),define("main",["one","two","three"],function(e,t,n){});
Coordinator
Jun 10, 2014 at 6:43 PM
Okay, yeah, so look at the dependencies and for each one, if there's a file with that name (that hasn't already been pulled in), suck it in automatically. It's definitely been something that we've considered before, but no one has asked for it (before you), so we never actually tried doing it. I'll see what I can do about bumping up the priority.
Jun 11, 2014 at 3:24 AM
That would be very nice. I'd like to use it to combine WinJS file modules into bundled modules. Thanks.
Sep 6, 2014 at 12:42 AM
I'm interested in this as well. I have a asp.net mvc project that I wanted to start using requirejs for loading modules. I'm looking for ways of doing the optimization/bundling without using r.js build tool. I'm currently utilizing cassette for bundling, which leverages AjaxMin. It seems like it would be nice to be able to tell cassette the main js file for each page, and have AjaxMin parse the dependencies and pull them all in automatically into bundle. I believe cassette has some functionality for bringing in dependencies via ///reference comments in each JS file, but I don't like that approach. I've searched through this codebase and saw some references to AMD. Is there anything implemented that would be able to accomplish what I am looking for?