{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel-loader/issues/163","repository_url":"https://api.github.com/repos/babel/babel-loader","labels_url":"https://api.github.com/repos/babel/babel-loader/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel-loader/issues/163/comments","events_url":"https://api.github.com/repos/babel/babel-loader/issues/163/events","html_url":"https://github.com/babel/babel-loader/issues/163","id":118263276,"number":163,"title":"Babel-polyfill file-size, using in webpack","user":{"login":"NXTaar","id":8634095,"avatar_url":"https://avatars.githubusercontent.com/u/8634095?v=3","gravatar_id":"","url":"https://api.github.com/users/NXTaar","html_url":"https://github.com/NXTaar","followers_url":"https://api.github.com/users/NXTaar/followers","following_url":"https://api.github.com/users/NXTaar/following{/other_user}","gists_url":"https://api.github.com/users/NXTaar/gists{/gist_id}","starred_url":"https://api.github.com/users/NXTaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NXTaar/subscriptions","organizations_url":"https://api.github.com/users/NXTaar/orgs","repos_url":"https://api.github.com/users/NXTaar/repos","events_url":"https://api.github.com/users/NXTaar/events{/privacy}","received_events_url":"https://api.github.com/users/NXTaar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2015-11-22T13:21:46Z","updated_at":"2016-08-15T06:27:03Z","closed_at":"2016-01-15T18:27:00Z","body":"Hello, i need some help with the Webpack configuation. I'm using Babel 6, and i think i'm doing something wrong...\r\n\r\nIn my project, in most of cases, i need async/await and Promise functionality, so here is my Webpack config for Babel\r\n\r\nLoaders part\r\n```\r\nloaders: [\r\n            {\r\n                // ES6 & 7 to ES5 transpiller (polyfills)\r\n                loader: \"babel-loader\",\r\n\r\n                // Skip any files outside of your project's `src` directory\r\n                exclude: [\r\n                    path.resolve(__dirname, \"node_modules\"),\r\n                ],\r\n\r\n                // Only run `.js` and `.jsx` files through Babel\r\n                test: /\\.jsx?$/,\r\n\r\n                // Options to configure babel with\r\n                query: {\r\n                    presets: ['es2015', 'stage-0']\r\n                }\r\n            },\r\n            //... bla bla bla\r\n```\r\n\r\nEntry point part\r\n\r\n```\r\nentry:\r\n    {\r\n        common: \"babel-polyfill\",\r\n        App: './app'\r\n    },\r\n```\r\n\r\nWith such config i'm getting the needed functionality, and it works fine.\r\n**BUT!**\r\nif we look to the compiled files we will see this:\r\n```\r\nC:\\Projects\\Work\\FPB\\2.0>webpack\r\nHash: 9877443dac97580f5531\r\nVersion: webpack 1.12.8\r\nTime: 1270ms\r\n    Asset       Size  Chunks             Chunk Names\r\n   App.js    10.9 kB       0  [emitted]  App\r\n   1.1.js  867 bytes       1  [emitted]\r\ncommon.js     450 kB       2  [emitted]  common\r\n    + 194 hidden modules\r\n\r\n```\r\nSo, as i understood, my ```common.js``` (i'm using CommonsChunkPlugin) is containig the babel-polyfill file and it **weights 450kb**!! Is it normal for such file size?\r\nSo i was digging deeper, and run webpack as ```webpack --display-modules```, and i saw this:\r\nhttps://gist.github.com/NXTaar/06df116dd2210cdcc060\r\n\r\nWe have here, that my bundle was including a lot of fuctions, which i, actially, don't need at all (for example some ```es6.math.log10.js``` and etc.) and, as i understood, all this modules is required by ```babel-polyfill```.\r\n\r\nIs it a way to compile only those, which i'm using in my project right now (f.e. async, await, Promise, or some more, if i decide to use additional ES6 features).\r\n\r\nI tried to use Babel 5, because it was compilling only needed thing, but i can't config it proper for async/await. It gave me an error, when it tries to work in browser.\r\n\r\nAny help, or an advice, would be appreciated.\r\n\r\nAnd if your sugjestion will be *use Babel 5* please tell me why i should do that (i need to understand all stuff, for preventing more questions in the future :blush: ), give me proper webpack config (loader, entry points, plugins, etc.), and all ```npm install`` statements needed, for i can get my async/await and Promises to work, because i couldn't do it myself\r\n"},"comment":{"url":"https://api.github.com/repos/babel/babel-loader/issues/comments/239737133","html_url":"https://github.com/babel/babel-loader/issues/163#issuecomment-239737133","issue_url":"https://api.github.com/repos/babel/babel-loader/issues/163","id":239737133,"user":{"login":"sotream","id":11646166,"avatar_url":"https://avatars.githubusercontent.com/u/11646166?v=3","gravatar_id":"","url":"https://api.github.com/users/sotream","html_url":"https://github.com/sotream","followers_url":"https://api.github.com/users/sotream/followers","following_url":"https://api.github.com/users/sotream/following{/other_user}","gists_url":"https://api.github.com/users/sotream/gists{/gist_id}","starred_url":"https://api.github.com/users/sotream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sotream/subscriptions","organizations_url":"https://api.github.com/users/sotream/orgs","repos_url":"https://api.github.com/users/sotream/repos","events_url":"https://api.github.com/users/sotream/events{/privacy}","received_events_url":"https://api.github.com/users/sotream/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T06:27:03Z","updated_at":"2016-08-15T06:27:03Z","body":"**tracker1** can you provide some example with babel polyfill. \r\nThanks"}}
{"actor":{"display_login":"sotream"}}