{"action":"created","issue":{"url":"https://api.github.com/repos/moment/moment/issues/2113","labels_url":"https://api.github.com/repos/moment/moment/issues/2113/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/2113/comments","events_url":"https://api.github.com/repos/moment/moment/issues/2113/events","html_url":"https://github.com/moment/moment/issues/2113","id":52506126,"number":2113,"title":"AMD: Multiple anonymous defines in locale bundles","user":{"login":"lnwdr","id":1770511,"avatar_url":"https://avatars.githubusercontent.com/u/1770511?v=3","gravatar_id":"","url":"https://api.github.com/users/lnwdr","html_url":"https://github.com/lnwdr","followers_url":"https://api.github.com/users/lnwdr/followers","following_url":"https://api.github.com/users/lnwdr/following{/other_user}","gists_url":"https://api.github.com/users/lnwdr/gists{/gist_id}","starred_url":"https://api.github.com/users/lnwdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnwdr/subscriptions","organizations_url":"https://api.github.com/users/lnwdr/orgs","repos_url":"https://api.github.com/users/lnwdr/repos","events_url":"https://api.github.com/users/lnwdr/events{/privacy}","received_events_url":"https://api.github.com/users/lnwdr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-19T17:12:22Z","updated_at":"2015-01-05T14:53:19Z","closed_at":null,"body":"This affects the following files:\r\n\r\n* `min/locales.js`\r\n* `min/locales.min.js`\r\n* `min/moment-with-locales.js`\r\n* `min/moment-with-locales.min.js`\r\n\r\nThese files each contain multiple anonymous `define`s which makes it impossible to load them AMD style (e.g. with require.js).\r\n\r\nThe sources for each locale are simply concatenated in those files. To make them work properly, the locale module's name would have to be included in each locale's `define` call."},"comment":{"url":"https://api.github.com/repos/moment/moment/issues/comments/68717685","html_url":"https://github.com/moment/moment/issues/2113#issuecomment-68717685","issue_url":"https://api.github.com/repos/moment/moment/issues/2113","id":68717685,"user":{"login":"lnwdr","id":1770511,"avatar_url":"https://avatars.githubusercontent.com/u/1770511?v=3","gravatar_id":"","url":"https://api.github.com/users/lnwdr","html_url":"https://github.com/lnwdr","followers_url":"https://api.github.com/users/lnwdr/followers","following_url":"https://api.github.com/users/lnwdr/following{/other_user}","gists_url":"https://api.github.com/users/lnwdr/gists{/gist_id}","starred_url":"https://api.github.com/users/lnwdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnwdr/subscriptions","organizations_url":"https://api.github.com/users/lnwdr/orgs","repos_url":"https://api.github.com/users/lnwdr/repos","events_url":"https://api.github.com/users/lnwdr/events{/privacy}","received_events_url":"https://api.github.com/users/lnwdr/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T14:53:19Z","updated_at":"2015-01-05T14:53:19Z","body":"@ichernev One solution would be to use [named `define` calls](http://requirejs.org/docs/api.html#modulename) instead of anonymous ones. E.g.:\r\n\r\n```js\r\n// in: locale/de.js\r\ndefine(\"moment-locale-de\", [\"moment\"], function() { /* ... */ });\r\n```\r\n\r\nI'm just not sure about the naming scheme of the locale modules but since moment itself is also hard coded in the locale modules, I guess it could be ok. Right now, the locale files don't work at all with AMD loaders, when you want bundle them into a bigger JS file and this change wouldn't break anything. So why not?"}}