{"action":"created","issue":{"url":"https://api.github.com/repos/requirejs/r.js/issues/613","repository_url":"https://api.github.com/repos/requirejs/r.js","labels_url":"https://api.github.com/repos/requirejs/r.js/issues/613/labels{/name}","comments_url":"https://api.github.com/repos/requirejs/r.js/issues/613/comments","events_url":"https://api.github.com/repos/requirejs/r.js/issues/613/events","html_url":"https://github.com/requirejs/r.js/issues/613","id":26562815,"number":613,"title":"Generate bundles config if wanted","user":{"login":"jrburke","id":73359,"avatar_url":"https://avatars.githubusercontent.com/u/73359?v=3","gravatar_id":"","url":"https://api.github.com/users/jrburke","html_url":"https://github.com/jrburke","followers_url":"https://api.github.com/users/jrburke/followers","following_url":"https://api.github.com/users/jrburke/following{/other_user}","gists_url":"https://api.github.com/users/jrburke/gists{/gist_id}","starred_url":"https://api.github.com/users/jrburke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrburke/subscriptions","organizations_url":"https://api.github.com/users/jrburke/orgs","repos_url":"https://api.github.com/users/jrburke/repos","events_url":"https://api.github.com/users/jrburke/events{/privacy}","received_events_url":"https://api.github.com/users/jrburke/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/requirejs/r.js/milestones/24","html_url":"https://github.com/requirejs/r.js/milestone/24","labels_url":"https://api.github.com/repos/requirejs/r.js/milestones/24/labels","id":271129,"number":24,"title":"2.2.0","description":null,"creator":{"login":"jrburke","id":73359,"avatar_url":"https://avatars.githubusercontent.com/u/73359?v=3","gravatar_id":"","url":"https://api.github.com/users/jrburke","html_url":"https://github.com/jrburke","followers_url":"https://api.github.com/users/jrburke/followers","following_url":"https://api.github.com/users/jrburke/following{/other_user}","gists_url":"https://api.github.com/users/jrburke/gists{/gist_id}","starred_url":"https://api.github.com/users/jrburke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrburke/subscriptions","organizations_url":"https://api.github.com/users/jrburke/orgs","repos_url":"https://api.github.com/users/jrburke/repos","events_url":"https://api.github.com/users/jrburke/events{/privacy}","received_events_url":"https://api.github.com/users/jrburke/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":12,"state":"closed","created_at":"2013-02-19T23:27:58Z","updated_at":"2016-09-04T05:46:26Z","due_on":null,"closed_at":"2016-09-04T05:46:26Z"},"comments":24,"created_at":"2014-01-29T23:25:10Z","updated_at":"2017-02-26T18:32:13Z","closed_at":"2016-03-17T00:36:37Z","body":"requirejs 2.1.10 supports a bundles config in the runtime, but right now it requires the developer to construct those bundles. Having them generated by r.js would be useful.\n\nA bit tricky in that it means inserting build config.\n"},"comment":{"url":"https://api.github.com/repos/requirejs/r.js/issues/comments/282576236","html_url":"https://github.com/requirejs/r.js/issues/613#issuecomment-282576236","issue_url":"https://api.github.com/repos/requirejs/r.js/issues/613","id":282576236,"user":{"login":"chrisknoll","id":6818777,"avatar_url":"https://avatars.githubusercontent.com/u/6818777?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisknoll","html_url":"https://github.com/chrisknoll","followers_url":"https://api.github.com/users/chrisknoll/followers","following_url":"https://api.github.com/users/chrisknoll/following{/other_user}","gists_url":"https://api.github.com/users/chrisknoll/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisknoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisknoll/subscriptions","organizations_url":"https://api.github.com/users/chrisknoll/orgs","repos_url":"https://api.github.com/users/chrisknoll/repos","events_url":"https://api.github.com/users/chrisknoll/events{/privacy}","received_events_url":"https://api.github.com/users/chrisknoll/received_events","type":"User","site_admin":false},"created_at":"2017-02-26T18:32:13Z","updated_at":"2017-02-26T18:32:13Z","body":"Yeah, I can understand the tool complexity getting out of control and also your point is taken about single file optimize. However, in the case of packages, it's not single file, and passing the package name as the moduleID to optimize means that the only way to get at any module in the package is to leverage a bundleConfig so that every module contained therein is 'discoverable'.  \r\n\r\nWhat would happen if when a r.js optimize call produces an outfile, that the set of moduleIDs that were put into the outfile created a new entry in the require config's bundle list? \r\n\r\nFor example if i have a package 'someLib' with 5 Modules in it (ModA..ModC) and I did a r.js build with name=\"someLib\" (passing the config options to resolve the someLib to the appropriate location), It will build the outputfile someLib.min.js.\r\n\r\nThe contents of that outfile might look something like this:\r\n\r\n```javascript\r\n\r\ndefine('someLib/main',[..deps..], function(..deps...) { } );\r\n\r\ndefine('someLib/ModA',[..deps..], function(..deps...) { } );\r\n\r\ndefine('someLib/ModB',[..deps..], function(..deps...) { } );\r\n\r\ndefine('someLib/ModC',[..deps..], function(..deps...) { } );\r\n\r\n````\r\n\r\nI recall seeing a comment you made in either one of the commits or one of the other threads where you parsed the resulting file for module IDs (you mentioned that it was slower, but handled edge cases better).  Is there a way to get at the function that you built that given an optimized file it can generate a list of moduleIDs that are contained within the file? If that existed, then all I'd do is have a post-step of running the function, given the outfile as an input and get out the list of module IDs....\r\n\r\nBasically the code you have here:\r\n\r\n```\r\n  var bundleContents = file.readFile(finalPath);\r\n  var excludeMap = {};\r\n  excludeMap[module.name] = true;\r\n  var parsedIds = parse.getAllNamedDefines(bundleContents, excludeMap);\r\n  entryConfig.push.apply(entryConfig, parsedIds);\r\n```\r\n\r\nBasically I want to do the above to the outfile. How would I be able to invoke this code as a sort of stand alone function call?  Again, I very much apologize i'm not a node user, so I'm not completely familiar with the capabilities....\r\n"}}
{"actor":{"display_login":"chrisknoll"}}