{"action":"created","issue":{"url":"https://api.github.com/repos/dailymotion/hls.js/issues/131","labels_url":"https://api.github.com/repos/dailymotion/hls.js/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/dailymotion/hls.js/issues/131/comments","events_url":"https://api.github.com/repos/dailymotion/hls.js/issues/131/events","html_url":"https://github.com/dailymotion/hls.js/issues/131","id":122058796,"number":131,"title":"Add Webpack require compatibility","user":{"login":"winduptoy","id":270504,"avatar_url":"https://avatars.githubusercontent.com/u/270504?v=3","gravatar_id":"","url":"https://api.github.com/users/winduptoy","html_url":"https://github.com/winduptoy","followers_url":"https://api.github.com/users/winduptoy/followers","following_url":"https://api.github.com/users/winduptoy/following{/other_user}","gists_url":"https://api.github.com/users/winduptoy/gists{/gist_id}","starred_url":"https://api.github.com/users/winduptoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winduptoy/subscriptions","organizations_url":"https://api.github.com/users/winduptoy/orgs","repos_url":"https://api.github.com/users/winduptoy/repos","events_url":"https://api.github.com/users/winduptoy/events{/privacy}","received_events_url":"https://api.github.com/users/winduptoy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-14T14:57:34Z","updated_at":"2015-12-15T13:42:38Z","closed_at":null,"body":"When I `require('hls.js')`, [Webpack](https://webpack.github.io) complains about not recognizing ES6. When I `require('hls.js/dist/hls.js')` (the built sources), Webpack complains:\r\n\r\n```\r\nThis seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.\r\n```\r\n\r\nSo I tried to load it with [Babel](https://babeljs.io/) `require('babel?presets[]=es2015!hls.js')` to hopefully compile it to ES5, but Webpack errors out with:\r\n```\r\nERROR in ./~/hls.js/src/events.js\r\nERROR in ./~/hls.js/src/errors.js\r\nERROR in ./~/hls.js/src/loader/playlist-loader.js\r\nERROR in ./~/hls.js/src/loader/fragment-loader.js\r\n...\r\nModule parse failed: Unexpected token. You may need an appropriate loader to handle this file type.\r\n```\r\n\r\nIt seems what's happening is that Webpack will successfully load `./src/hls.js` with Babel, but any subsequently imported files are not loaded with Babel, and thus it doesn't recognize ES6."},"comment":{"url":"https://api.github.com/repos/dailymotion/hls.js/issues/comments/164767854","html_url":"https://github.com/dailymotion/hls.js/issues/131#issuecomment-164767854","issue_url":"https://api.github.com/repos/dailymotion/hls.js/issues/131","id":164767854,"user":{"login":"kanongil","id":753512,"avatar_url":"https://avatars.githubusercontent.com/u/753512?v=3","gravatar_id":"","url":"https://api.github.com/users/kanongil","html_url":"https://github.com/kanongil","followers_url":"https://api.github.com/users/kanongil/followers","following_url":"https://api.github.com/users/kanongil/following{/other_user}","gists_url":"https://api.github.com/users/kanongil/gists{/gist_id}","starred_url":"https://api.github.com/users/kanongil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanongil/subscriptions","organizations_url":"https://api.github.com/users/kanongil/orgs","repos_url":"https://api.github.com/users/kanongil/repos","events_url":"https://api.github.com/users/kanongil/events{/privacy}","received_events_url":"https://api.github.com/users/kanongil/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T13:42:38Z","updated_at":"2015-12-15T13:42:38Z","body":"@winduptoy You need to specify that all files in the `hls.js/src` directory should be preprocessed using babel in your config file."}}