{"action":"created","issue":{"url":"https://api.github.com/repos/rollup/babel-preset-es2015-rollup/issues/7","repository_url":"https://api.github.com/repos/rollup/babel-preset-es2015-rollup","labels_url":"https://api.github.com/repos/rollup/babel-preset-es2015-rollup/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/rollup/babel-preset-es2015-rollup/issues/7/comments","events_url":"https://api.github.com/repos/rollup/babel-preset-es2015-rollup/issues/7/events","html_url":"https://github.com/rollup/babel-preset-es2015-rollup/issues/7","id":169612391,"number":7,"title":"preset not properly filtering module presets from babel-preset-es2015","user":{"login":"eventualbuddha","id":1938,"avatar_url":"https://avatars.githubusercontent.com/u/1938?v=3","gravatar_id":"","url":"https://api.github.com/users/eventualbuddha","html_url":"https://github.com/eventualbuddha","followers_url":"https://api.github.com/users/eventualbuddha/followers","following_url":"https://api.github.com/users/eventualbuddha/following{/other_user}","gists_url":"https://api.github.com/users/eventualbuddha/gists{/gist_id}","starred_url":"https://api.github.com/users/eventualbuddha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eventualbuddha/subscriptions","organizations_url":"https://api.github.com/users/eventualbuddha/orgs","repos_url":"https://api.github.com/users/eventualbuddha/repos","events_url":"https://api.github.com/users/eventualbuddha/events{/privacy}","received_events_url":"https://api.github.com/users/eventualbuddha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-05T13:54:06Z","updated_at":"2016-08-05T13:56:21Z","closed_at":null,"body":"This is likely the root cause of #6, and decaffeinate/decaffeinate#365, and more. Essentially the issue is that babel-preset-es2015 previously looked like this:\r\n\r\n```js\r\nmodule.exports = {\r\n  plugins: [\r\n    require(\"babel-plugin-transform-es2015-template-literals\"),\r\n    require(\"babel-plugin-transform-es2015-literals\"),\r\n    require(\"babel-plugin-transform-es2015-function-name\"),\r\n    require(\"babel-plugin-transform-es2015-arrow-functions\"),\r\n    require(\"babel-plugin-transform-es2015-block-scoped-functions\"),\r\n    require(\"babel-plugin-transform-es2015-classes\"),\r\n    require(\"babel-plugin-transform-es2015-object-super\"),\r\n    require(\"babel-plugin-transform-es2015-shorthand-properties\"),\r\n    require(\"babel-plugin-transform-es2015-duplicate-keys\"),\r\n    require(\"babel-plugin-transform-es2015-computed-properties\"),\r\n    require(\"babel-plugin-transform-es2015-for-of\"),\r\n    require(\"babel-plugin-transform-es2015-sticky-regex\"),\r\n    require(\"babel-plugin-transform-es2015-unicode-regex\"),\r\n    require(\"babel-plugin-check-es2015-constants\"),\r\n    require(\"babel-plugin-transform-es2015-spread\"),\r\n    require(\"babel-plugin-transform-es2015-parameters\"),\r\n    require(\"babel-plugin-transform-es2015-destructuring\"),\r\n    require(\"babel-plugin-transform-es2015-block-scoping\"),\r\n    require(\"babel-plugin-transform-es2015-typeof-symbol\"),\r\n    require(\"babel-plugin-transform-es2015-modules-commonjs\"),\r\n    [require(\"babel-plugin-transform-regenerator\"), { async: false, asyncGenerators: false }],\r\n  ]\r\n};\r\n```\r\n\r\nNow it looks like this:\r\n\r\n```js\r\n\"use strict\";\r\n\r\n/**\r\n * This file is a bit of a mess. If you're looking at it as a reference for how to write a preset,\r\n * I'd recommend looking only at `function preset(){}` and ignoring the rest, unless your new preset\r\n * really needs to work on babel-core < 6.13.x, which is unlikely.\r\n */\r\n\r\n/**\r\n * This preset was originally an object, before function-based configurable presets were introduced.\r\n * For backward-compatibility with anything that may have been loading this preset and expecting\r\n * it to be a simple Babel config object, we maintain the old config here.\r\n */\r\nmodule.exports = preset({});\r\n\r\n// For backward compatibility with babel-core < v6.13.x, we use the 'buildPreset' property\r\n// of the preset object for the preset creation function.\r\nObject.defineProperty(module.exports, \"buildPreset\", {\r\n  configurable: true,\r\n  writable: true,\r\n  // We make this non-enumerable so old versions of babel-core won't see it as an unknown property,\r\n  // while allowing new versions to see it as a preset builder function.\r\n  enumerable: false,\r\n  value: preset\r\n});\r\n\r\nfunction preset(context, opts) {\r\n  var moduleTypes = [\"commonjs\", \"amd\", \"umd\", \"systemjs\"];\r\n  var loose = false;\r\n  var modules = \"commonjs\";\r\n\r\n  if (opts !== undefined) {\r\n    if (opts.loose !== undefined) loose = opts.loose;\r\n    if (opts.modules !== undefined) modules = opts.modules;\r\n  }\r\n\r\n  if (typeof loose !== \"boolean\") throw new Error(\"Preset es2015 'loose' option must be a boolean.\");\r\n  if (modules !== false && moduleTypes.indexOf(modules) === -1) {\r\n    throw new Error(\"Preset es2015 'modules' option must be 'false' to indicate no modules\\n\" + \"or a module type which be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'\");\r\n  }\r\n\r\n  return {\r\n    plugins: [[require(\"babel-plugin-transform-es2015-template-literals\"), { loose: loose }], require(\"babel-plugin-transform-es2015-literals\"), require(\"babel-plugin-transform-es2015-function-name\"), [require(\"babel-plugin-transform-es2015-arrow-functions\")], require(\"babel-plugin-transform-es2015-block-scoped-functions\"), [require(\"babel-plugin-transform-es2015-classes\"), { loose: loose }], require(\"babel-plugin-transform-es2015-object-super\"), require(\"babel-plugin-transform-es2015-shorthand-properties\"), require(\"babel-plugin-transform-es2015-duplicate-keys\"), [require(\"babel-plugin-transform-es2015-computed-properties\"), { loose: loose }], [require(\"babel-plugin-transform-es2015-for-of\"), { loose: loose }], require(\"babel-plugin-transform-es2015-sticky-regex\"), require(\"babel-plugin-transform-es2015-unicode-regex\"), require(\"babel-plugin-check-es2015-constants\"), [require(\"babel-plugin-transform-es2015-spread\"), { loose: loose }], require(\"babel-plugin-transform-es2015-parameters\"), [require(\"babel-plugin-transform-es2015-destructuring\"), { loose: loose }], require(\"babel-plugin-transform-es2015-block-scoping\"), require(\"babel-plugin-transform-es2015-typeof-symbol\"), modules === \"commonjs\" && [require(\"babel-plugin-transform-es2015-modules-commonjs\"), { loose: loose }], modules === \"systemjs\" && [require(\"babel-plugin-transform-es2015-modules-systemjs\"), { loose: loose }], modules === \"amd\" && [require(\"babel-plugin-transform-es2015-modules-amd\"), { loose: loose }], modules === \"umd\" && [require(\"babel-plugin-transform-es2015-modules-umd\"), { loose: loose }], [require(\"babel-plugin-transform-regenerator\"), { async: false, asyncGenerators: false }]\r\n    // filter out falsy values\r\n    ].filter(Boolean)\r\n  };\r\n}\r\n```\r\n\r\nThe fact that the module ones are all arrays with a `loose` option prevents this preset from filtering them. [modify-babel-preset](https://github.com/developit/modify-babel-preset) just added support for exactly this situation, so I think we should use it."},"comment":{"url":"https://api.github.com/repos/rollup/babel-preset-es2015-rollup/issues/comments/237856869","html_url":"https://github.com/rollup/babel-preset-es2015-rollup/issues/7#issuecomment-237856869","issue_url":"https://api.github.com/repos/rollup/babel-preset-es2015-rollup/issues/7","id":237856869,"user":{"login":"eventualbuddha","id":1938,"avatar_url":"https://avatars.githubusercontent.com/u/1938?v=3","gravatar_id":"","url":"https://api.github.com/users/eventualbuddha","html_url":"https://github.com/eventualbuddha","followers_url":"https://api.github.com/users/eventualbuddha/followers","following_url":"https://api.github.com/users/eventualbuddha/following{/other_user}","gists_url":"https://api.github.com/users/eventualbuddha/gists{/gist_id}","starred_url":"https://api.github.com/users/eventualbuddha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eventualbuddha/subscriptions","organizations_url":"https://api.github.com/users/eventualbuddha/orgs","repos_url":"https://api.github.com/users/eventualbuddha/repos","events_url":"https://api.github.com/users/eventualbuddha/events{/privacy}","received_events_url":"https://api.github.com/users/eventualbuddha/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T13:56:21Z","updated_at":"2016-08-05T13:56:21Z","body":"Hah! This preset already uses it. Just need to update."}}
{"actor":{"display_login":"eventualbuddha"}}