{"action":"closed","issue":{"url":"https://api.github.com/repos/systemjs/builder/issues/346","labels_url":"https://api.github.com/repos/systemjs/builder/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/builder/issues/346/comments","events_url":"https://api.github.com/repos/systemjs/builder/issues/346/events","html_url":"https://github.com/systemjs/builder/issues/346","id":110748242,"number":346,"title":"Not able to use functions provided by core-js with optional runtime babelOptions","user":{"login":"prathamesh7pute","id":1848287,"avatar_url":"https://avatars.githubusercontent.com/u/1848287?v=3","gravatar_id":"","url":"https://api.github.com/users/prathamesh7pute","html_url":"https://github.com/prathamesh7pute","followers_url":"https://api.github.com/users/prathamesh7pute/followers","following_url":"https://api.github.com/users/prathamesh7pute/following{/other_user}","gists_url":"https://api.github.com/users/prathamesh7pute/gists{/gist_id}","starred_url":"https://api.github.com/users/prathamesh7pute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prathamesh7pute/subscriptions","organizations_url":"https://api.github.com/users/prathamesh7pute/orgs","repos_url":"https://api.github.com/users/prathamesh7pute/repos","events_url":"https://api.github.com/users/prathamesh7pute/events{/privacy}","received_events_url":"https://api.github.com/users/prathamesh7pute/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemjs/builder/labels/support","name":"support","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-09T22:46:18Z","updated_at":"2015-10-12T05:59:19Z","closed_at":"2015-10-12T05:59:18Z","body":"By using the following System.js configuration Builder\r\n\r\ngulp task \r\n````\r\n  var builder = new Builder('.', 'system.config.js');\r\n  builder.buildStatic('main', output.js, {minify:true, sourceMaps:true});\r\n````\r\n\r\nsystem.js\r\n````\r\nSystem.config({\r\n    baseUrl: './',\r\n    defaultJSExtensions: true,\r\n    transpiler: 'babel',\r\n    babelOptions: {\r\n        optional: [\r\n            'runtime'\r\n        ]\r\n    },\r\n    map: {\r\n        ...\r\n   }\r\n});\r\n````\r\n\r\nIf code is using any core-js aliasing like Map, Set, Symbol etc its not getting bundled, transpiled\r\nscript.js (for e.g)\r\n \r\n````\r\n    var sym = Symbol();\r\n    var promise = new Promise();\r\n````\r\n\r\nissue seems to be with the system.js builder not passing proper path for babel to find core-js\r\nas when in bundle step traspiler babel tries to find the core-js it is referring to wrong path of core-js/library \r\n(it tries to find the core-js in the baseURL path pass to new Builder('.', 'system.config.js' )\r\n\r\nBut if same script run through babel it works -\r\n$ babel --optional runtime script.js \r\n"}}