{"action":"created","issue":{"url":"https://api.github.com/repos/requirejs/r.js/issues/911","repository_url":"https://api.github.com/repos/requirejs/r.js","labels_url":"https://api.github.com/repos/requirejs/r.js/issues/911/labels{/name}","comments_url":"https://api.github.com/repos/requirejs/r.js/issues/911/comments","events_url":"https://api.github.com/repos/requirejs/r.js/issues/911/events","html_url":"https://github.com/requirejs/r.js/issues/911","id":151222583,"number":911,"title":"bundlesconfigoutfile - no such file or directory","user":{"login":"pavkum","id":3970582,"avatar_url":"https://avatars.githubusercontent.com/u/3970582?v=3","gravatar_id":"","url":"https://api.github.com/users/pavkum","html_url":"https://github.com/pavkum","followers_url":"https://api.github.com/users/pavkum/followers","following_url":"https://api.github.com/users/pavkum/following{/other_user}","gists_url":"https://api.github.com/users/pavkum/gists{/gist_id}","starred_url":"https://api.github.com/users/pavkum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavkum/subscriptions","organizations_url":"https://api.github.com/users/pavkum/orgs","repos_url":"https://api.github.com/users/pavkum/repos","events_url":"https://api.github.com/users/pavkum/events{/privacy}","received_events_url":"https://api.github.com/users/pavkum/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-26T19:45:52Z","updated_at":"2016-04-28T15:36:29Z","closed_at":"2016-04-28T15:36:29Z","body":"Hello,\r\n  This may not be an issue, but I couldn't get much information regarding **bundles config** outside. So directly requesting for help here.\r\n\r\n  We are trying to do whole project optimizations and so far we have few modules defined. So far everything looks fine.  We have couple of libraries, helpers which are common across multiple modules. So we thought of using bundles to list and load them. \r\n   \r\n  Now I wanted to automatically trace these dependencies across multiple modules and wanted to export them as config using **bundlesconfigoutfile** property (Is my assumption correct here?).\r\n\r\n  But when I set up the property during r.js optimization I get error saying no such file or directory for the outFile which I have specified for **bundlesconfigoutfile** property while tracing dependencies(this file generates automatically right?).  What am I doing wrong?\r\n\r\n Please find my requirejs config below\r\n`\r\n    \r\n    {\r\n       \"appDir\": \"courses\",\r\n       \"baseUrl\": \".\",\r\n       \"dir\": \"build_courses\",\r\n       \"optimize\": \"none\",\r\n        \"shim\": {\r\n           \"jquery\": {\r\n           \"exports\": \"jQuery\"\r\n         },\r\n        \"underscore\": {\r\n           \"exports\": \"_\"\r\n        },\r\n        \"ember\": {\r\n           \"deps\": [\r\n              \"jquery\"\r\n           ],\r\n           \"exports\": \"Ember\"\r\n        }\r\n      },\r\n      \"paths\": {\r\n      \"jquery\": \"../lib/jquery/jquery\",\r\n       \"underscore\": \"../lib/underscore/underscore\",\r\n       \"ember\": \"../lib/ember/ember.debug\",\r\n      },\r\n\r\n      \"modules\": [{\r\n          name: \"courses/index\",\r\n          excludes: [\r\n            'jquery',\r\n            'ember',\r\n         ]\r\n      }, {\r\n        name: \"dummy\",\r\n        create: true,\r\n        include: [\r\n           \"courses/routes/coursesRoute\"\r\n        ]\r\n      }],\r\n      \"bundlesConfigOutFile\": \"../bundles.config.js\"\r\n     }`\r\n\r\n\r\nIn my set up, courses/index module has reference to courses/routes/coursesRoute. My dummy module references the same. I thought **bundlesconfigoutfile** will extract out this common dependency. Am I correct here?"},"comment":{"url":"https://api.github.com/repos/requirejs/r.js/issues/comments/215469685","html_url":"https://github.com/requirejs/r.js/issues/911#issuecomment-215469685","issue_url":"https://api.github.com/repos/requirejs/r.js/issues/911","id":215469685,"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},"created_at":"2016-04-28T15:36:29Z","updated_at":"2016-04-28T15:36:29Z","body":"bundlesConfigOutFile needs to target the js file that has your primary requirejs.config() call so that it can inject the bundle config into that config call. This makes sure the config will be registered before the rest of module loading occurs. So, it is not designed to be used to output to a new file.\r\n\r\nClosing as a discussion ticket, but feel free to continue discussion here."}}