{"action":"created","issue":{"url":"https://api.github.com/repos/douglasduteil/isparta/issues/45","labels_url":"https://api.github.com/repos/douglasduteil/isparta/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/douglasduteil/isparta/issues/45/comments","events_url":"https://api.github.com/repos/douglasduteil/isparta/issues/45/events","html_url":"https://github.com/douglasduteil/isparta/issues/45","id":91164734,"number":45,"title":"gulp babel and isparta","user":{"login":"eddiemoore","id":199016,"avatar_url":"https://avatars.githubusercontent.com/u/199016?v=3","gravatar_id":"","url":"https://api.github.com/users/eddiemoore","html_url":"https://github.com/eddiemoore","followers_url":"https://api.github.com/users/eddiemoore/followers","following_url":"https://api.github.com/users/eddiemoore/following{/other_user}","gists_url":"https://api.github.com/users/eddiemoore/gists{/gist_id}","starred_url":"https://api.github.com/users/eddiemoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddiemoore/subscriptions","organizations_url":"https://api.github.com/users/eddiemoore/orgs","repos_url":"https://api.github.com/users/eddiemoore/repos","events_url":"https://api.github.com/users/eddiemoore/events{/privacy}","received_events_url":"https://api.github.com/users/eddiemoore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-26T05:59:03Z","updated_at":"2015-08-26T02:13:23Z","closed_at":null,"body":"For some reason I can't use the normal ES6 imports with isparta in my gulpfile. If I use require it all works correctly, runs all my tests and covers all my code. But when I change over to use import I get:\r\n```js\r\n$ gulp mocha\r\n[14:54:55] Requiring external module babel/register\r\n[14:54:56] Using gulpfile ~/Work/XXX/gulpfile.babel.js\r\n[14:54:56] Starting 'istanbul'...\r\n\r\nevents.js:85\r\n      throw er; // Unhandled 'error' event\r\n            ^\r\nError: Unable to parse /Users/ed/Work/XXX/src/chat.js\r\n\r\nLine 1: Unexpected reserved word\r\n```\r\n\r\n**gulpfile:**\r\n```js\r\nimport gulp from 'gulp'\r\nimport istanbul from 'gulp-istanbul'\r\n// import isparta from 'isparta' // Doesn't work\r\nconst isparta = require('isparta') // Works\r\nimport mocha from 'gulp-mocha'\r\n\r\ngulp.task('istanbul', cb => {\r\n  gulp.src(['./src/**/*.js'])\r\n    .pipe(istanbul({\r\n      instrumenter: isparta.Instrumenter,\r\n      includeUntested: true,\r\n      babel: { stage: 0 }\r\n    }))\r\n    .pipe(istanbul.hookRequire())\r\n    .on('finish', cb)\r\n})\r\n\r\ngulp.task('mocha', ['istanbul'], () => {\r\n  return gulp.src('./test/**/*.js')\r\n    .pipe(mocha({\r\n      reporter: 'spec'\r\n    }))\r\n    .pipe(istanbul.writeReports({\r\n      dir: './coverage',\r\n      reportOpts: {dir: './coverage'},\r\n      reporters: ['lcovonly']\r\n    }))\r\n})\r\n```"},"comment":{"url":"https://api.github.com/repos/douglasduteil/isparta/issues/comments/134794093","html_url":"https://github.com/douglasduteil/isparta/issues/45#issuecomment-134794093","issue_url":"https://api.github.com/repos/douglasduteil/isparta/issues/45","id":134794093,"user":{"login":"jedmao","id":1058243,"avatar_url":"https://avatars.githubusercontent.com/u/1058243?v=3","gravatar_id":"","url":"https://api.github.com/users/jedmao","html_url":"https://github.com/jedmao","followers_url":"https://api.github.com/users/jedmao/followers","following_url":"https://api.github.com/users/jedmao/following{/other_user}","gists_url":"https://api.github.com/users/jedmao/gists{/gist_id}","starred_url":"https://api.github.com/users/jedmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedmao/subscriptions","organizations_url":"https://api.github.com/users/jedmao/orgs","repos_url":"https://api.github.com/users/jedmao/repos","events_url":"https://api.github.com/users/jedmao/events{/privacy}","received_events_url":"https://api.github.com/users/jedmao/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T02:13:23Z","updated_at":"2015-08-26T02:13:23Z","body":"Wow, @StefanoDalpiaz, thanks for the in-depth explanation. It's all perfectly clear now :)"}}