{"action":"created","issue":{"url":"https://api.github.com/repos/rollup/rollup/issues/568","repository_url":"https://api.github.com/repos/rollup/rollup","labels_url":"https://api.github.com/repos/rollup/rollup/issues/568/labels{/name}","comments_url":"https://api.github.com/repos/rollup/rollup/issues/568/comments","events_url":"https://api.github.com/repos/rollup/rollup/issues/568/events","html_url":"https://github.com/rollup/rollup/issues/568","id":142697072,"number":568,"title":"variable declerations being swallowed","user":{"login":"calvinmetcalf","id":1128607,"avatar_url":"https://avatars.githubusercontent.com/u/1128607?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinmetcalf","html_url":"https://github.com/calvinmetcalf","followers_url":"https://api.github.com/users/calvinmetcalf/followers","following_url":"https://api.github.com/users/calvinmetcalf/following{/other_user}","gists_url":"https://api.github.com/users/calvinmetcalf/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinmetcalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinmetcalf/subscriptions","organizations_url":"https://api.github.com/users/calvinmetcalf/orgs","repos_url":"https://api.github.com/users/calvinmetcalf/repos","events_url":"https://api.github.com/users/calvinmetcalf/events{/privacy}","received_events_url":"https://api.github.com/users/calvinmetcalf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rollup/rollup/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-22T16:04:33Z","updated_at":"2016-03-27T04:59:01Z","closed_at":null,"body":"this file\r\n\r\n```js\r\nvar foo = 21;\r\n\r\nvar module = {exports: {}};\r\n\r\nvar exports = module.exports;\r\n\r\nexport {exports as default};\r\n\r\nmodule.exports = foo * 2;\r\n\r\nif (module.exports !== exports){exports = module.exports;}\r\n```\r\n\r\ngets turned into \r\n\r\n```js\r\nvar foo = 21;\r\n\r\nvar module$1 = {exports: {}};\r\n\r\nexports.default = module.exports;\r\n\r\nmodule$1.exports = foo * 2;\r\n\r\nif (module$1.exports !== exports$1){exports$1 = module$1.exports;}\r\n\r\nexport default exports$1;\r\n```\r\n\r\nI've even got the bizarre line \r\n\r\n```js\r\nvar exports.exports$1 = module$1.exports;\r\n```\r\n\r\nto be generated once.\r\n\r\nMy guess is that this has to do with modifying the variable we export as default which (afaik) is totally legit to do in es6 modules."},"comment":{"url":"https://api.github.com/repos/rollup/rollup/issues/comments/201992187","html_url":"https://github.com/rollup/rollup/issues/568#issuecomment-201992187","issue_url":"https://api.github.com/repos/rollup/rollup/issues/568","id":201992187,"user":{"login":"Rich-Harris","id":1162160,"avatar_url":"https://avatars.githubusercontent.com/u/1162160?v=3","gravatar_id":"","url":"https://api.github.com/users/Rich-Harris","html_url":"https://github.com/Rich-Harris","followers_url":"https://api.github.com/users/Rich-Harris/followers","following_url":"https://api.github.com/users/Rich-Harris/following{/other_user}","gists_url":"https://api.github.com/users/Rich-Harris/gists{/gist_id}","starred_url":"https://api.github.com/users/Rich-Harris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rich-Harris/subscriptions","organizations_url":"https://api.github.com/users/Rich-Harris/orgs","repos_url":"https://api.github.com/users/Rich-Harris/repos","events_url":"https://api.github.com/users/Rich-Harris/events{/privacy}","received_events_url":"https://api.github.com/users/Rich-Harris/received_events","type":"User","site_admin":false},"created_at":"2016-03-27T04:59:01Z","updated_at":"2016-03-27T04:59:01Z","body":"Slightly simplified test [here](http://rollupjs.org/#%7B%22options%22%3A%7B%22format%22%3A%22es6%22%2C%22moduleName%22%3A%22myBundle%22%2C%22globals%22%3A%7B%7D%7D%2C%22modules%22%3A%5B%7B%22name%22%3A%22main.js%22%2C%22code%22%3A%22var%20module%20%3D%20%7Bexports%3A%20%7B%7D%7D%3B%5Cn%5Cnvar%20exports%20%3D%20module.exports%3B%5Cn%5Cnexport%20%7Bexports%20as%20default%7D%3B%5Cn%2F%2Fexport%20default%20exports%5Cn%5Cnexports%20%3D%20'x'%3B%22%7D%5D%7D). Looks like if you do\r\n\r\n```js\r\nexport default exports;\r\n```\r\n\r\nrather than\r\n\r\n```js\r\nexport { exports as default };\r\n```\r\n\r\nthings start to work as expected? Either way it's a bug"}}