{"action":"opened","issue":{"url":"https://api.github.com/repos/pjeby/regenerator-loader/issues/5","labels_url":"https://api.github.com/repos/pjeby/regenerator-loader/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pjeby/regenerator-loader/issues/5/comments","events_url":"https://api.github.com/repos/pjeby/regenerator-loader/issues/5/events","html_url":"https://github.com/pjeby/regenerator-loader/issues/5","id":116023583,"number":5,"title":"generator not compiled when webpack with babel-loader","user":{"login":"wangst321","id":2323692,"avatar_url":"https://avatars.githubusercontent.com/u/2323692?v=3","gravatar_id":"","url":"https://api.github.com/users/wangst321","html_url":"https://github.com/wangst321","followers_url":"https://api.github.com/users/wangst321/followers","following_url":"https://api.github.com/users/wangst321/following{/other_user}","gists_url":"https://api.github.com/users/wangst321/gists{/gist_id}","starred_url":"https://api.github.com/users/wangst321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangst321/subscriptions","organizations_url":"https://api.github.com/users/wangst321/orgs","repos_url":"https://api.github.com/users/wangst321/repos","events_url":"https://api.github.com/users/wangst321/events{/privacy}","received_events_url":"https://api.github.com/users/wangst321/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-10T04:29:37Z","updated_at":"2015-11-10T04:29:37Z","closed_at":null,"body":"webpack.js::\r\n\r\n  loaders: [{ test: /\\.js$/, loader: 'babel',}]\r\n\r\napp.js::\r\n\r\n  require('regenerator!./generator.js');\r\n\r\ngenerator.js::\r\n\r\n  function * range(start, end) {\r\n      for (let i=start; i<end; i++) {\r\n          yield i;\r\n      }\r\n  }\r\n\r\n  for (let i of range(1, 10)) {\r\n      console.log(i);\r\n  }\r\n\r\nRun the compilation with::\r\n\r\n  $ webpack -o bundle.js app.js\r\n\r\nUntil now, everything is ok. But when running ``bundle.js`` in firefox::\r\n\r\n  regeneratorRuntime is not defined\r\n\r\nSo, after a few try and google, i guess maybe the ``loader`` does not work. I edit ``regenerator-loader/index.js`` , logging the source before the compile test. I found the following interesting:\r\n\r\n    var marked0$0 = [range].map(regeneratorRuntime.mark);\r\n    function range(start, end) {\r\n        var i;\r\n        return regeneratorRuntime.wrap(function range$(context$1$0) {\r\n            while (1) switch (context$1$0.prev = context$1$0.next) {\r\n    ...\r\n\r\nit seems ``babel-loader`` has already compile the souce with  ``regeneratorRuntime.mark``, as a result ``regenerator-loader`` will not compile it because it fail to find ``function * `` or `` async function`` , and ``runtime`` is not added.\r\n"}}